Skip to content

Commit 9fecf97

Browse files
Handle "release candidate" approach for publication
1 parent db45c3e commit 9fecf97

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

.github/workflows/pr-to-publish.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,38 @@ jobs:
1111
env:
1212
GITHUB_TOKEN: ${{ github.token }}
1313
permissions:
14-
contents: read
14+
contents: write
1515
pull-requests: write
1616
steps:
1717
- uses: actions/checkout@v6
1818
- name: Get current date
1919
id: date
2020
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
2121

22+
- name: Remove existing staging branch if it exists
23+
run: |
24+
# Check if local staging branch exists and delete it
25+
if git show-ref --verify --quiet refs/heads/staging; then
26+
git branch -D staging
27+
fi
28+
29+
# Check if remote staging branch exists and delete it
30+
if git ls-remote --exit-code --heads origin staging; then
31+
git push origin --delete staging
32+
fi
33+
34+
- name: Checkout staging branch
35+
run: |
36+
git checkout -b staging
37+
38+
- name: Push staging branch
39+
run: |
40+
git push origin staging
41+
2242
- name: Create pull request
2343
run: |
24-
gh pr create --base publication --head main \
44+
gh pr create --base publication --head staging \
2545
--reviewer remibetin \
2646
--reviewer daniel-montalvo \
2747
--title "WAI website update ${{ steps.date.outputs.date }}" \
28-
--body "This is an automated pull request to publish ACT content to the WAI website."
48+
--body "This is a release candidate batch to be published to the WAI website after review and approval by WAI Staff."

0 commit comments

Comments
 (0)