Skip to content

Commit fee421d

Browse files
authored
Merge pull request #102 from DenisValeev/codex/create-github-actions-for-pr-merge
2 parents 6a46f6e + c085b15 commit fee421d

5 files changed

Lines changed: 503 additions & 52 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Refresh offline manifest
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
update-offline-manifest:
13+
if: github.event.pull_request.merged == true
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.base.ref }}
20+
fetch-depth: 0
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
27+
- name: Generate offline manifest
28+
env:
29+
GITHUB_SHA: ${{ github.event.pull_request.merge_commit_sha || github.event.pull_request.head.sha }}
30+
run: node tools/generate-offline-manifest.js
31+
32+
- name: Commit offline manifest update
33+
run: |
34+
if git diff --quiet -- offline-manifest.json; then
35+
echo "No offline manifest changes to commit."
36+
exit 0
37+
fi
38+
git config user.name "github-actions[bot]"
39+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
40+
git add offline-manifest.json
41+
git commit -m "chore: refresh offline manifest for #${{ github.event.pull_request.number }}"
42+
git push origin HEAD:${{ github.event.pull_request.base.ref }}

0 commit comments

Comments
 (0)