Skip to content

Commit 39c07f1

Browse files
authored
ci: Replace third-party GitHub Actions with trusted alternatives (#521)
1 parent 081690d commit 39c07f1

3 files changed

Lines changed: 34 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v3
1717
- name: Check NPM lock file version
18-
uses: mansona/npm-lockfile-version@v1
19-
with:
20-
version: 2
18+
run: |
19+
version=$(node -e "console.log(require('./package-lock.json').lockfileVersion)")
20+
if [ "$version" != "2" ]; then
21+
echo "::error::Expected lockfileVersion 2, got $version"
22+
exit 1
23+
fi
2124
build:
2225
runs-on: ubuntu-20.04
2326
timeout-minutes: 30

.github/workflows/release-automated.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ jobs:
3030
if: needs.release.outputs.current_tag != ''
3131
runs-on: ubuntu-latest
3232
timeout-minutes: 15
33+
permissions:
34+
pages: write
35+
id-token: write
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deploy.outputs.page_url }}
3339
steps:
3440
- uses: actions/checkout@v3
3541
with:
@@ -49,8 +55,12 @@ jobs:
4955
npm run document
5056
env:
5157
SOURCE_TAG: ${{ needs.release.outputs.current_tag }}
52-
- name: Deploy
53-
uses: peaceiris/actions-gh-pages@v3.7.3
58+
- name: Configure Pages
59+
uses: actions/configure-pages@v5
60+
- name: Upload Pages artifact
61+
uses: actions/upload-pages-artifact@v4
5462
with:
55-
github_token: ${{ secrets.GITHUB_TOKEN }}
56-
publish_dir: ./.phpdoc/build
63+
path: ./.phpdoc/build
64+
- name: Deploy to GitHub Pages
65+
id: deploy
66+
uses: actions/deploy-pages@v4

.github/workflows/release-manual-docs.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ jobs:
1313
if: github.event.inputs.tag != ''
1414
runs-on: ubuntu-latest
1515
timeout-minutes: 15
16+
permissions:
17+
pages: write
18+
id-token: write
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deploy.outputs.page_url }}
1622
steps:
1723
- uses: actions/checkout@v3
1824
with:
@@ -32,8 +38,12 @@ jobs:
3238
npm run document
3339
env:
3440
SOURCE_TAG: ${{ github.event.inputs.tag }}
35-
- name: Deploy
36-
uses: peaceiris/actions-gh-pages@v3.7.3
41+
- name: Configure Pages
42+
uses: actions/configure-pages@v5
43+
- name: Upload Pages artifact
44+
uses: actions/upload-pages-artifact@v4
3745
with:
38-
github_token: ${{ secrets.GITHUB_TOKEN }}
39-
publish_dir: ./.phpdoc/build
46+
path: ./.phpdoc/build
47+
- name: Deploy to GitHub Pages
48+
id: deploy
49+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)