Skip to content

Commit

Permalink
chore: Use commit SHAs in workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpens committed Nov 27, 2024
1 parent d6f99bb commit 82ae0dc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/feature-branch-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- name: Check out branch to access .nvmrc
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: actions/setup-node@v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: .nvmrc

- name: Check out gh-pages branch
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: gh-pages

Expand All @@ -41,7 +41,7 @@ jobs:
git push
- name: Deactivate deployment
uses: bobheadxi/deployments@v1
uses: bobheadxi/deployments@648679e8e4915b27893bd7dbc35cb504dc915bc8 # v1.5.0
if: always()
with:
step: deactivate-env
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/feature-branch-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ jobs:
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- name: Check out
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Create deployment
uses: bobheadxi/deployments@v1
uses: bobheadxi/deployments@648679e8e4915b27893bd7dbc35cb504dc915bc8 # v1.5.0
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: demo-${{ env.BRANCH_NAME }}

- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- uses: actions/setup-node@v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
cache: pnpm
node-version-file: .nvmrc
Expand All @@ -52,22 +52,22 @@ jobs:
touch ./storybook/dist/${{ github.sha }}.txt
- name: Pushing to pages branch
uses: JamesIves/github-pages-deploy-action@v4
uses: JamesIves/github-pages-deploy-action@62fec3add6773ec5dbbf18d2ee4260911aa35cf4 # v4.6.9
with:
branch: gh-pages
folder: storybook/dist
target-folder: demo-${{ env.BRANCH_NAME }}

- name: Wait for GitHub Pages to be deployed
uses: mydea/action-wait-for-api@v2
uses: mydea/action-wait-for-api@45d9c58e690337a05eb5ae14a1478f29eacbf9db # v2.0.0
with:
url: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/demo-${{ env.BRANCH_NAME }}/${{ github.sha }}.txt
expected-status: 200
timeout: 600
interval: 15

- name: Update deployment status
uses: bobheadxi/deployments@v1
uses: bobheadxi/deployments@648679e8e4915b27893bd7dbc35cb504dc915bc8 # v1.5.0
if: always()
with:
step: finish
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:

steps:
- name: Check out branch
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set up Node.js version
uses: actions/setup-node@v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
cache: pnpm
node-version-file: .nvmrc
Expand All @@ -31,13 +31,13 @@ jobs:

steps:
- name: Check out branch
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0

- name: Set up Node.js version
uses: actions/setup-node@v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
cache: pnpm
node-version-file: .nvmrc
Expand All @@ -58,7 +58,7 @@ jobs:
pnpm run --if-present test
- name: "Retain build artifact: Storybook"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: storybook
path: storybook/dist/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-title-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: PR title validation
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:

steps:
- name: Create release
uses: googleapis/release-please-action@v4
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
target-branch: main

# The logic below handles the npm publication:
- name: Check out branch
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# This is necessary because on.workflow_run always runs on the
# default branch, which is 'develop' in our case
Expand All @@ -31,11 +31,11 @@ jobs:
if: ${{ steps.release.outputs.releases_created == 'true' }}

- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
if: ${{ steps.release.outputs.releases_created == 'true' }}

- name: Set up Node.js version
uses: actions/setup-node@v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
cache: pnpm
node-version-file: .nvmrc
Expand All @@ -58,15 +58,15 @@ jobs:

# The logic below handles the Storybook deploy:
- name: "Restore build artifact: Storybook"
uses: dawidd6/action-download-artifact@v6
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6
with:
workflow: "lint-test.yml"
name: storybook
path: dist/storybook
if: ${{ steps.release.outputs.releases_created == 'true' }}

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
uses: JamesIves/github-pages-deploy-action@62fec3add6773ec5dbbf18d2ee4260911aa35cf4 # v4.6.9
with:
branch: gh-pages
folder: dist/storybook
Expand Down

0 comments on commit 82ae0dc

Please sign in to comment.