chore(deps): lock file maintenance #1077
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Build | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
upload_release_file: | |
type: boolean | |
default: false | |
description: Upload generated release file as an artifact. | |
release_version: | |
type: string | |
default: "" | |
required: true | |
description: Use this string as version in the application. | |
env: | |
TEST_REPO: kattecon/gh-app-access-token-gen-test | |
jobs: | |
check: | |
name: Build, lint and test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup nodejs | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version: lts/* | |
- name: Build, lint and package if needed | |
run: | | |
if test -e Makefile; then | |
make build lint release-file | |
else | |
echo "Not building. It's supposed to be a release tag/branch then." | |
fi | |
- name: Generate token using app_id, pk and repo-name (1) | |
id: test_case_1_gen | |
uses: ./ | |
with: | |
app_id: ${{ secrets.TEST_APP_ID }} | |
private_key: ${{ secrets.TEST_APP_PK }} | |
repository: ${{ env.TEST_REPO }} | |
- name: Test access using token from (1) | |
env: | |
GH_TOKEN: ${{ steps.test_case_1_gen.outputs.token }} | |
run: gh repo view "$TEST_REPO" --json name | |
- name: Generate token using app id, pk and installation id (2) | |
id: test_case_2_gen | |
uses: ./ | |
with: | |
app_id: ${{ secrets.TEST_APP_ID }} | |
private_key: ${{ secrets.TEST_APP_PK }} | |
installation_id: ${{ secrets.TEST_APP_INST_ID }} | |
- name: Test access using token from (2) | |
env: | |
GH_TOKEN: ${{ steps.test_case_2_gen.outputs.token }} | |
run: gh repo view "$TEST_REPO" --json name | |
- name: Upload release artifact | |
if: "${{ github.event.inputs.upload_release_file == 'true' }}" | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
with: | |
name: release | |
path: release.tar.gz |