Skip to content

Commit b9565d4

Browse files
committed
Adding refme to manage GitHub Action references.
refme will automatically convert git refs into full git hashes. This eliminates one class of Action attack.
1 parent 561668d commit b9565d4

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

Diff for: .github/workflows/branchtest.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212

1313
- name: Generate changelog
1414
id: changelog
15+
# refme: ignore
1516
uses: metcalfc/changelog-generator@main
1617
with:
1718
myToken: ${{ secrets.GITHUB_TOKEN }}

Diff for: .github/workflows/test.yml

+4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ jobs:
1010
uses: actions/checkout@v4
1111
- name: Generate changelog
1212
id: changelog
13+
# refme: ignore
1314
uses: metcalfc/changelog-generator@main
1415
with:
1516
myToken: ${{ secrets.GITHUB_TOKEN }}
1617
head-ref: 'v0.0.2'
1718
base-ref: 'v0.0.1'
1819
- name: Reverse the generated changelog
1920
id: changelog-rev
21+
# refme: ignore
2022
uses: metcalfc/changelog-generator@main
2123
with:
2224
myToken: ${{ secrets.GITHUB_TOKEN }}
@@ -25,6 +27,7 @@ jobs:
2527
reverse: 'true'
2628
- name: Explicitly do not reverse the generated changelog
2729
id: changelog-notrev
30+
# refme: ignore
2831
uses: metcalfc/changelog-generator@main
2932
with:
3033
myToken: ${{ secrets.GITHUB_TOKEN }}
@@ -55,6 +58,7 @@ jobs:
5558
EOF
5659
- name: Generate changelog from release
5760
id: release
61+
# refme: ignore
5862
uses: metcalfc/changelog-generator@main
5963
with:
6064
myToken: ${{ secrets.GITHUB_TOKEN }}

Diff for: package-lock.json

+25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
"postversion": "git push && git push --tags",
1414
"precommit-msg": "echo 'Pre-commit checks...' && exit 0",
1515
"precommit": "npm run build && git add dist/",
16+
"refme": "npm exec gh-refme -- convert ./.github/workflows/*",
1617
"test": "echo \"Error: no test specified\" && exit 1",
1718
"version": "npm run bump:readme && npm run bump:workflow && git add ./dist ./README.md ./SECURITY.md ./.github/workflows/*yml"
1819
},
1920
"pre-commit": [
2021
"precommit-msg",
2122
"lint",
2223
"format-check",
24+
"refme",
2325
"precommit"
2426
],
2527
"repository": {
@@ -47,9 +49,10 @@
4749
"@actions/github": "^6.0.0"
4850
},
4951
"devDependencies": {
52+
"@eslint/js": "^9.22.0",
5053
"@vercel/ncc": "^0.38.3",
5154
"eslint": "^9.22.0",
52-
"@eslint/js": "^9.22.0",
55+
"gh-refme": "^1.5.0",
5356
"globals": "^16.0.0",
5457
"isexe": "^3.1.1",
5558
"pre-commit": "^1.2.2",

0 commit comments

Comments
 (0)