Skip to content

Commit

Permalink
chore(main): update github actions node version
Browse files Browse the repository at this point in the history
  • Loading branch information
StanHannebelle committed Oct 27, 2022
1 parent 886f696 commit 70b3263
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 62 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14]
node: [16]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: node --version
Expand Down
112 changes: 56 additions & 56 deletions .github/workflows/release-please.yaml
Expand Up @@ -9,51 +9,51 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install
run: npm ci
- name: build
run: npm run build
- name: commit
run: |-
set -e
# get current commit hash
CURRENT_HASH=$(git rev-parse HEAD)
# get last commit hash of last build dist
LAST_BUILD_HASH=$(git log --author=google-github-actions-bot -1 --pretty=format:"%H")
DIFF=""
# build and commit dist if diff
git config --global user.name "actions-bot"
git config user.email 'github-actions-bot@google.com'
git add dist/
git diff-index --quiet HEAD || git commit -m "chore: build dist ${ACTION_NAME}"
# if last commit hash of last build dist was found, get logs of commits in btw for PR body
if [ -z "$LAST_BUILD_HASH" ]
then
echo "Unable to find last commit by bot, skipping diff gen"
else
DIFF=$(git log ${LAST_BUILD_HASH}...${CURRENT_HASH} --oneline)
echo $DIFF
fi
# set env vars
echo "CURRENT_HASH=${CURRENT_HASH}" >> $GITHUB_ENV
echo "LAST_BUILD_HASH=${LAST_BUILD_HASH}" >> $GITHUB_ENV
echo 'DIFF<<EOF' >> $GITHUB_ENV
echo "${DIFF}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Create PR with dist
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Build dist
author: "actions-bot <github-actions-bot@google.com>"
title: "chore: build dist"
body: |
Build dist PR
${{env.DIFF}}
labels: automated pr
branch: create-pull-request/build-dist
delete-branch: true
- uses: actions/checkout@v3
- name: install
run: npm ci
- name: build
run: npm run build
- name: commit
run: |-
set -e
# get current commit hash
CURRENT_HASH=$(git rev-parse HEAD)
# get last commit hash of last build dist
LAST_BUILD_HASH=$(git log --author=google-github-actions-bot -1 --pretty=format:"%H")
DIFF=""
# build and commit dist if diff
git config --global user.name "actions-bot"
git config user.email 'github-actions-bot@google.com'
git add dist/
git diff-index --quiet HEAD || git commit -m "chore: build dist ${ACTION_NAME}"
# if last commit hash of last build dist was found, get logs of commits in btw for PR body
if [ -z "$LAST_BUILD_HASH" ]
then
echo "Unable to find last commit by bot, skipping diff gen"
else
DIFF=$(git log ${LAST_BUILD_HASH}...${CURRENT_HASH} --oneline)
echo $DIFF
fi
# set env vars
echo "CURRENT_HASH=${CURRENT_HASH}" >> $GITHUB_ENV
echo "LAST_BUILD_HASH=${LAST_BUILD_HASH}" >> $GITHUB_ENV
echo 'DIFF<<EOF' >> $GITHUB_ENV
echo "${DIFF}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Create PR with dist
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Build dist
author: "actions-bot <github-actions-bot@google.com>"
title: "chore: build dist"
body: |
Build dist PR
${{env.DIFF}}
labels: automated pr
branch: create-pull-request/build-dist
delete-branch: true
release-please-pr:
runs-on: ubuntu-latest
needs: [build]
Expand All @@ -69,16 +69,16 @@ jobs:
if: ${{ steps.release-pr.outputs.pr }}
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
await github.issues.addLabels({
owner,
repo,
issue_number: ${{steps.release-pr.outputs.pr}},
labels: ['autorelease: pending']
});
console.log(`Tagged ${{steps.release-pr.outputs.pr}}`)
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
await github.issues.addLabels({
owner,
repo,
issue_number: ${{steps.release-pr.outputs.pr}},
labels: ['autorelease: pending']
});
console.log(`Tagged ${{steps.release-pr.outputs.pr}}`)
release-please-release:
runs-on: ubuntu-latest
needs: [build]
Expand All @@ -90,7 +90,7 @@ jobs:
release-type: node
package-name: ${{env.ACTION_NAME}}
command: github-release
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: tag major and patch versions
run: |
git config user.name github-actions[bot]
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Expand Up @@ -27,5 +27,5 @@ branding:
color: 'yellow'

runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -25,8 +25,8 @@
},
"homepage": "https://github.com/bcoe/release-please-action#readme",
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/github": "^5.0.0",
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"@conventional-commits/parser": "^0.4.1",
"unist-util-visit": "^4.1.0"
},
Expand Down

0 comments on commit 70b3263

Please sign in to comment.