-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
5,012 additions
and
2,413 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
4 changes: 2 additions & 2 deletions
4
...test_failure_repository_not_installed.yml → .github/workflows/test-failure.yml
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
# Tests this action success by the application already being installed on the repository | ||
|
||
name: Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: The name of the branch to checkout for the action | ||
required: true | ||
default: main | ||
|
||
# One build per branch, cancel out of date builds only on pull requests | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
|
||
permissions: | ||
contents: read | ||
actions: read | ||
packages: read | ||
deployments: read | ||
|
||
jobs: | ||
# Not currently used | ||
# test-installed-repo: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout specified branch | ||
# if: github.event_name == 'workflow_dispatch' | ||
# uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
# with: | ||
# ref: ${{ github.event.inputs.branch }} | ||
|
||
# - name: Checkout | ||
# if: github.event_name != 'workflow_dispatch' | ||
# uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
|
||
# - name: Use action | ||
# id: use_action | ||
# uses: ./ | ||
# with: | ||
# application_id: ${{ secrets.GHA_APPLICATION_ID }} | ||
# application_private_key: ${{ secrets.GHA_APPLICATION_PRIVATE_KEY }} | ||
|
||
# - name: Use token to read details | ||
# uses: actions/github-script@v7 # v6 | ||
# with: | ||
# github-token: ${{ steps.use_action.outputs.token }} | ||
# script: | | ||
# const repo = github.rest.repos.get({ | ||
# owner: context.repo.owner, | ||
# repo: context.repo.repo, | ||
# }) | ||
# console.log(JSON.stringify(repo, null, 2)); | ||
|
||
# - name: Use token to checkout repository | ||
# uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
# with: | ||
# token: ${{ steps.use_action.outputs.token }} | ||
# repository: sammcj/demo-gha-install-token | ||
|
||
test-mocha: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
|
||
- name: Run tests | ||
continue-on-error: true | ||
run: | | ||
npm ci | ||
npm run test | ||
test-installed-limited: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
|
||
- name: Use action | ||
id: use_action | ||
uses: ./ | ||
with: | ||
application_id: ${{ secrets.GHA_APPLICATION_ID }} | ||
application_private_key: ${{ secrets.GHA_APPLICATION_PRIVATE_KEY }} | ||
organization: CattleDip | ||
permissions: "contents:read,actions:read,packages:read,deployments:read,workflows:read" | ||
|
||
- name: Use token to read details | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ steps.use_action.outputs.token }} | ||
script: | | ||
const repo = github.rest.repos.get({ | ||
owner: 'CattleDip', | ||
repo: 'demo-gha-install-token', | ||
}) | ||
console.log(JSON.stringify(repo, null, 2)); | ||
- name: Use token to checkout repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
with: | ||
token: ${{ steps.use_action.outputs.token }} | ||
repository: sammcj/demo-gha-install-token | ||
|
||
test-installed-org: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout specified branch | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
|
||
- name: Checkout | ||
if: github.event_name != 'workflow_dispatch' | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
|
||
- name: Use action | ||
id: use_action | ||
uses: ./ | ||
with: | ||
application_id: ${{ secrets.GHA_APPLICATION_ID }} | ||
application_private_key: ${{ secrets.GHA_APPLICATION_PRIVATE_KEY }} | ||
organization: CattleDip | ||
|
||
- name: Use token to read details | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ steps.use_action.outputs.token }} | ||
script: | | ||
const repo = github.rest.repos.get({ | ||
owner: 'CattleDip', | ||
repo: 'demo-gha-install-token', | ||
}) | ||
console.log(JSON.stringify(repo, null, 2)); | ||
- name: Use token to checkout repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
with: | ||
token: ${{ steps.use_action.outputs.token }} | ||
repository: CattleDip/demo-gha-install-token | ||
|
||
# If all tests pass AND we are on main, run the bump and release | ||
release: | ||
runs-on: ubuntu-latest | ||
if: success() && github.ref == 'refs/heads/main' | ||
needs: | ||
# - test-installed-repo | ||
# - test-installed-limited #TODO: get working | ||
- test-installed-org | ||
permissions: | ||
contents: write | ||
packages: write | ||
deployments: write | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: "npm" | ||
- run: | | ||
npm ci | ||
npm run build | ||
- name: Bump version and push tag | ||
id: tag_version | ||
if: github.ref == 'refs/heads/main' | ||
uses: mathieudutour/github-tag-action@fcfbdceb3093f6d85a3b194740f8c6cec632f4e2 # v6.1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
release_branches: main | ||
pre_release_branches: dev | ||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1 | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
generateReleaseNotes: true | ||
allowUpdates: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.