forked from aws-amplify/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (27 loc) · 1.16 KB
/
update_references.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Receive repository dispatch event
on:
# Listen to a repository dispatch event by the name of `dispatch-event`
repository_dispatch:
types: [update-references]
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Set Branch Name
run: echo "BRANCH_NAME=$(echo $(date +%s))" >> $GITHUB_ENV
- name: Create new branch
run: |
git config user.email "[email protected]"
git config user.name "Your Name"
git checkout -b ${{ env.BRANCH_NAME }}
curl -L -o ${{ vars.REF_LOC }} ${{ vars.REMOTE_REF }}
git add ${{ vars.REF_LOC }}
git commit -m "updating references"
git push -u origin ${{ env.BRANCH_NAME }}
- name: Create Pull Request
run: gh pr create -B main -H ${{ env.BRANCH_NAME }} --title 'Merge ${{ env.BRANCH_NAME }} into main' --body 'Created by Github action'