File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22name : Build Auto-Generated Files
33on :
44 workflow_call :
5-
5+ inputs :
6+ baseSha :
7+ type : string
8+ required : false
9+ buildAll :
10+ type : boolean
11+ required : false
12+ default : false
613jobs :
714 build-contributors :
815 name : Build Contributors
916 if : github.repository != 'AdobeDocs/dev-docs-template'
10- uses : ./.github/workflows/build-contributors.yml
17+ uses : ./.github/workflows/build-contributors-v2.yml
18+ with :
19+ baseSha : ${{ inputs.baseSha }}
20+ buildAll : ${{ inputs.buildAll }}
1121 secrets : inherit
1222
1323 build-site-metadata :
1626 if : |
1727 always() &&
1828 github.repository != 'AdobeDocs/dev-docs-template'
19- uses : ./.github/workflows/build-site-metadata.yml
29+ uses : ./.github/workflows/build-site-metadata-v2.yml
30+ secrets : inherit
Original file line number Diff line number Diff line change 22name : Build Contributors
33on :
44 workflow_call :
5-
5+ inputs :
6+ baseSha :
7+ type : string
8+ required : false
9+ buildAll :
10+ type : boolean
11+ required : false
12+ default : false
613jobs :
714 build-contributors :
815 runs-on : ubuntu-latest
1219 - name : Checkout
1320 uses : actions/checkout@v4
1421 with :
15- ref : ${{ github.head_ref }}
1622 fetch-depth : 0
23+ persist-credentials : false
1724
1825 - name : Generate GitHub App token
1926 id : app-token
@@ -23,15 +30,17 @@ jobs:
2330 private-key : ${{ secrets.ADP_DEVSITE_APP_PRIVATE_KEY }}
2431
2532 - name : Build Contributors
26- run : npx --yes github:AdobeDocs/adp-devsite-utils buildContributors -v
33+ run : npx --yes github:AdobeDocs/adp-devsite-utils buildContributorsV2 -v ${{ inputs.buildAll && '--all' || '' }}
2734 env :
2835 GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
36+ BASE_SHA : ${{ inputs.baseSha || github.event.before }}
2937
3038 - name : Commit and push if changed
3139 run : |
3240 git config user.name "github-actions[bot]"
3341 git config user.email "github-actions[bot]@users.noreply.github.com"
42+ git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}
3443 git add src/pages/contributors.json
35- git diff --cached --quiet || git commit -m "Generate contributors"
36- git pull --rebase
44+ git pull
45+ git diff --cached --quiet || git commit -m "chore: auto-generate contributors"
3746 git push
Original file line number Diff line number Diff line change 22name : Build Site Metadata
33on :
44 workflow_call :
5-
65jobs :
76 build-site-metadata :
87 runs-on : ubuntu-latest
1211 - name : Checkout
1312 uses : actions/checkout@v4
1413 with :
15- ref : ${{ github.head_ref }}
14+ persist-credentials : false
15+
16+ - name : Generate GitHub App token
17+ id : app-token
18+ uses : actions/create-github-app-token@v1
19+ with :
20+ app-id : ${{ secrets.ADP_DEVSITE_APP_ID }}
21+ private-key : ${{ secrets.ADP_DEVSITE_APP_PRIVATE_KEY }}
1622
1723 - name : Build Site Metadata
1824 run : npx --yes github:AdobeDocs/adp-devsite-utils buildSiteMetadata -v
2127 run : |
2228 git config user.name "github-actions[bot]"
2329 git config user.email "github-actions[bot]@users.noreply.github.com"
30+ git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}
2431 git add src/pages/adp-site-metadata.json
25- git diff --cached --quiet || git commit -m "Generate site metadata"
26- git pull --rebase
32+ git pull
33+ git diff --cached --quiet || git commit -m "chore: auto-generate site metadata"
2734 git push
You can’t perform that action at this time.
0 commit comments