Skip to content

Commit fc11587

Browse files
committed
build: fix automation
1 parent 5303b22 commit fc11587

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.github/workflows/update-license.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,20 @@ jobs:
2020
steps:
2121
- name: Checkout
2222
uses: actions/[email protected]
23+
with:
24+
persist-credentials: false
2325
- name: Determine year
2426
id: year
2527
run: echo "::set-output name=value::$(date +%Y)"
2628
- name: Switch to '${{env.BRANCH}}'
2729
run: |
30+
CREDENTIALS="x-access-token:$GITHUB_TOKEN"
31+
URL="https://[email protected]/${{github.repository}}.git"
32+
git remote set-url origin $URL
2833
git fetch origin +refs/heads/$BRANCH:refs/heads/$BRANCH || true
2934
git checkout $BRANCH || git checkout -b $BRANCH
35+
env:
36+
GITHUB_TOKEN: ${{secrets.AUTOMATION_TOKEN}}
3037
- name: Update LICENSE
3138
run: sed -i -E "s/$REGEX/\1${{steps.year.outputs.value}}\2/" LICENSE
3239
- name: Check for changes
@@ -42,8 +49,12 @@ jobs:
4249
git config user.email ${{secrets.AUTOMATION_EMAIL}}
4350
git add LICENSE
4451
git commit -m "chore(license): update year to $YEAR"
52+
CREDENTIALS="x-access-token:$GITHUB_TOKEN"
53+
URL="https://[email protected]/${{github.repository}}.git"
54+
git remote set-url origin $URL
4555
git push --force origin $BRANCH
4656
env:
57+
GITHUB_TOKEN: ${{secrets.AUTOMATION_TOKEN}}
4758
YEAR: ${{steps.year.outputs.value}}
4859
- name: Create pull request
4960
if: steps.changes.outputs.exist

.github/workflows/update-node.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
steps:
2020
- name: Checkout
2121
uses: actions/[email protected]
22+
with:
23+
persist-credentials: false
2224
- name: Determine version
2325
id: node-version
2426
run: |
@@ -29,8 +31,13 @@ jobs:
2931
echo "::set-output name=old::$OLD_VERSION"
3032
- name: Switch to '${{env.BRANCH}}'
3133
run: |
34+
CREDENTIALS="x-access-token:$GITHUB_TOKEN"
35+
URL="https://[email protected]/${{github.repository}}.git"
36+
git remote set-url origin $URL
3237
git fetch origin +refs/heads/$BRANCH:refs/heads/$BRANCH || true
3338
git checkout $BRANCH || git checkout -b $BRANCH
39+
env:
40+
GITHUB_TOKEN: ${{secrets.AUTOMATION_TOKEN}}
3441
- name: Update .nvmrc
3542
run: echo ${{steps.node-version.outputs.new}} > .nvmrc
3643
- name: Check for changes
@@ -45,8 +52,12 @@ jobs:
4552
git config user.email ${{secrets.AUTOMATION_EMAIL}}
4653
git add .nvmrc
4754
git commit -m "chore(node): bump from $OLD_VERSION to $NEW_VERSION"
55+
CREDENTIALS="x-access-token:$GITHUB_TOKEN"
56+
URL="https://[email protected]/${{github.repository}}.git"
57+
git remote set-url origin $URL
4858
git push --force origin $BRANCH
4959
env:
60+
GITHUB_TOKEN: ${{secrets.AUTOMATION_TOKEN}}
5061
NEW_VERSION: ${{steps.node-version.outputs.new}}
5162
OLD_VERSION: ${{steps.node-version.outputs.old}}
5263
- name: Create pull request

0 commit comments

Comments
 (0)