Skip to content

Commit afcf916

Browse files
authored
Merge pull request #146 from aboutcode-org/keshav-space-patch-1
Pin down action to full-length commit SHA and sign-off automated commit
2 parents 13d7f3f + e4d7964 commit afcf916

File tree

2 files changed

+15
-26
lines changed

2 files changed

+15
-26
lines changed

.github/workflows/a-b-deploy.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
steps:
3535
- name: Checkout repo
36-
uses: actions/checkout@v4
36+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3737

3838
- name: Set deploy target
3939
id: set-target
@@ -45,7 +45,7 @@ jobs:
4545
fi
4646
4747
- name: Setup Node
48-
uses: actions/setup-node@v4
48+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f #v6.3.0
4949
with:
5050
node-version: 20
5151
cache: npm
@@ -64,7 +64,7 @@ jobs:
6464
npm run build
6565
6666
- name: Upload build artifact
67-
uses: actions/upload-artifact@v4
67+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
6868
with:
6969
name: docusaurus-build
7070
path: website/build
@@ -83,18 +83,18 @@ jobs:
8383

8484
steps:
8585
- name: Download build artifact
86-
uses: actions/download-artifact@v4
86+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
8787
with:
8888
name: docusaurus-build
8989
path: build
9090

9191
- name: Upload Pages artifact
92-
uses: actions/upload-pages-artifact@v3
92+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b #v4.0.0
9393
with:
9494
path: build
9595

9696
- name: Deploy to GitHub Pages
97-
uses: actions/deploy-pages@v4
97+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5
9898

9999

100100
deploy-dreamhost:
@@ -107,7 +107,7 @@ jobs:
107107

108108
steps:
109109
- name: Download build artifact
110-
uses: actions/download-artifact@v4
110+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
111111
with:
112112
name: docusaurus-build
113113
path: build

.github/workflows/update-releases.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ on:
66
# - cron: "15 * * * *" # every hour at :15
77
- cron: "15 9 * * *" # every day at 09:15 UTC
88

9-
permissions:
10-
contents: write # needed to commit updates to releases.json
11-
129
jobs:
1310
update:
1411
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write # needed to commit updates to releases.json
1514

1615
strategy:
1716
max-parallel: 1
@@ -52,19 +51,13 @@ jobs:
5251
- aboutcode-org/www.aboutcode.org
5352
# Add more repos here
5453

55-
env:
56-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
GITHUB_TOKEN: ${{ secrets.GH_REPO_POLLING }}
58-
5954
steps:
60-
6155
# 1 Checkout the target repo (Repo B)
6256
- name: Checkout repository
63-
uses: actions/checkout@v4
57+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6458
with:
6559
ref: main
6660
fetch-depth: 0
67-
token: ${{ secrets.GH_REPO_POLLING }}
6861

6962
# 2 Debug: show which repo is being processed
7063
- name: Debug - current repo
@@ -117,14 +110,10 @@ jobs:
117110
# 5 Commit & push changes if releases.json changed
118111
- name: Commit and push if changed
119112
run: |
120-
git config user.name "github-actions"
121-
git config user.email "github-actions@github.com"
113+
git config user.name "AboutCode Automation"
114+
git config user.email "automation@aboutcode.org"
122115
git add website/static/releases.json
123-
if ! git diff --cached --quiet; then
124-
git commit -m "Update releases for ${{ matrix.repo }}"
125-
git pull --rebase origin main
126-
git push
127-
else
128-
echo "No changes detected"
129-
fi
116+
git commit -m "$(echo -e "Update releases for ${{ matrix.repo }}\n\nSigned-off-by: AboutCode Automation <automation@aboutcode.org>")" || exit 0
117+
git pull --rebase origin main
118+
git push
130119
shell: bash

0 commit comments

Comments
 (0)