security: use commit hashes for GitHub Actions instead of version tags #1490
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Snap Build | |
| on: push | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| snap: | |
| runs-on: ubuntu-latest | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | |
| steps: | |
| - name: Install Snapcraft | |
| uses: samuelmeuli/action-snapcraft@d33c176a9b784876d966f80fb1b461808edc0641 # v2.1.1 | |
| - name: Check out Git repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Install Node.js and NPM | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: 22 | |
| - name: Build | |
| run: npm ci | |
| - name: Release | |
| if: contains(github.ref, 'main') | |
| run: npm run dist:linux:snap -- --publish always | |
| snap-armv7l: | |
| runs-on: ubuntu-latest | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | |
| steps: | |
| - name: Install Snapcraft | |
| uses: samuelmeuli/action-snapcraft@d33c176a9b784876d966f80fb1b461808edc0641 # v2.1.1 | |
| - name: Check out Git repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Install Node.js and NPM | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: 22 | |
| - name: Build | |
| run: npm ci | |
| - name: Release | |
| if: contains(github.ref, 'main') | |
| run: npm run dist:linux:snap:armv7l -- --publish always | |
| snap-arm64: | |
| runs-on: ubuntu-24.04-arm | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | |
| steps: | |
| - name: Install Snapcraft | |
| uses: samuelmeuli/action-snapcraft@d33c176a9b784876d966f80fb1b461808edc0641 # v2.1.1 | |
| - name: Install and initialize LXD | |
| uses: canonical/setup-lxd@62cd335190e2b612b427db9319ea6b59ab1691f8 # main | |
| - name: Check out Git repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Install Node.js and NPM | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: 22 | |
| - name: Build | |
| run: npm ci | |
| - name: Release | |
| if: contains(github.ref, 'main') | |
| run: npm run dist:linux:snap:arm64 -- --publish always | |