Skip to content

Commit

Permalink
Update workflow pins
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Apr 12, 2024
1 parent c0693e9 commit 5597354
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/draft-release.yml
Expand Up @@ -19,11 +19,11 @@ jobs:
name: 'Draft Release'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744' # ratchet:actions/checkout@v3

- uses: 'actions/setup-node@v3'
- uses: 'actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7' # ratchet:actions/setup-node@v3
with:
node-version: '16.x'
node-version: '20.x'

- name: 'Build and push'
shell: 'bash'
Expand All @@ -48,7 +48,7 @@ jobs:
git push origin $PR_BRANCH --force
- name: 'Generate release notes'
uses: 'actions/github-script@v6'
uses: 'actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410' # ratchet:actions/github-script@v6
with:
script: |-
let previousTagName = "";
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
}
- name: 'Create Pull Request'
uses: 'actions/github-script@v6'
uses: 'actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410' # ratchet:actions/github-script@v6
with:
github-token: '${{ secrets.ACTIONS_BOT_TOKEN }}'
script: |-
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Expand Up @@ -8,14 +8,14 @@ jobs:
name: 'Release'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744' # ratchet:actions/checkout@v3

- name: 'Get package version'
run: |-
echo "NEW_VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV
- name: 'Get previous release tag'
uses: 'actions/github-script@v6'
uses: 'actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410' # ratchet:actions/github-script@v6
with:
script: |-
try {
Expand All @@ -33,10 +33,10 @@ jobs:
}
- name: 'Create release'
uses: 'actions/github-script@v6'
uses: 'actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410' # ratchet:actions/github-script@v6
with:
script: |-
const tag = "v" + process.env.NEW_VERSION;
script: "const tag = \"v\" + process.env.NEW_VERSION;\n\ntry {\n const createReleaseRequest = {\n owner: context.repo.owner,\n repo: context.repo.repo,\n tag_name: tag,\n target_commitish: context.sha,\n name: tag,\n generate_release_notes: true,\n };\n\n if (process.env.PREV_TAG) {\n const releaseNotes = await github.rest.repos.generateReleaseNotes({\n owner: context.repo.owner,\n repo: context.repo.repo,\n tag_name: tag,\n target_commitish: context.sha,\n previous_tag_name: process.env.PREV_TAG,\n });\n \n createReleaseRequest.body = releaseNotes.data.body;\n createReleaseRequest.generate_release_notes = false;\n }\n\n const response = await github.rest.repos.createRelease(createReleaseRequest);\n\n core.info(\n `Created release ${response.data.name} at ${response.data.html_url}`\n );\n} catch (err) {\n core.setFailed(`Failed to create release: ${err}`);\n}"
uses: 'actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410' # ratchet:actions/github-script@v6

try {
const createReleaseRequest = {
Expand Down

0 comments on commit 5597354

Please sign in to comment.