Skip to content

Commit

Permalink
create update action
Browse files Browse the repository at this point in the history
  • Loading branch information
adelinn committed Sep 30, 2024
1 parent b4ee177 commit d038f29
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Update Version
run-name: Update Version ${{ github.event.inputs.major_version }} and ${{ github.event.inputs.target }}

on:
workflow_dispatch:
inputs:
target:
description: The tag or reference to use
required: true
major_version:
type: choice
description: The major version to update
options:
- v1

jobs:
tag:
runs-on: ubuntu-latest
steps:
# Note this update workflow can also be used as a rollback tool.
# For that reason, it's best to pin `actions/checkout` to a known, stable version
# (typically, about two releases back).
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- run: |
npm ci
npm i -g @vercel/ncc
ncc build index.js --license licenses.txt
- name: Git config
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Tag new target
run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }}
- name: Push new tag
run: git push origin ${{ github.event.inputs.major_version }} --force
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ outputs:
description: 'The resulting GitHub token, signed with the key stored in Azure Key Vault'
runs:
using: 'node20'
main: 'index.js'
main: 'dist/index.js'
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Script for enabling GitHub Action to sign a GitHub App token using a key stored in Azure Key Vault",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit d038f29

Please sign in to comment.