Compare commits

...

7 Commits

Author SHA1 Message Date
Gregor Martynus
803e078eb5 feat: use node20 as runner (#23)
Some checks failed
test / test (push) Has been cancelled
should be available now as per
https://github.com/actions/runner/issues/2619#issuecomment-1679003443
2023-08-22 10:24:39 -07:00
Gregor Martynus
9cf7227dfb ci(release): set version on release and push using git plugin (#22) 2023-08-22 09:25:53 -07:00
Parker Brown
7bbad93287 build(CODEOWNERS): update team name (#16) 2023-08-21 21:44:58 -07:00
Parker Brown
e5568a0249 ci(dependabot config): initial version (#15)
Configures Dependabot version updates, which enables Dependabot to open
pull requests automatically to keep dependencies up-to-date when new
versions are available.
2023-08-21 21:44:26 -07:00
Gregor Martynus
cb1fcdda59 fix(README): fix name in usage examples (#12)
Some checks failed
test / test (push) Has been cancelled
2023-08-21 15:09:16 -07:00
Gregor Martynus
12aa81137b fix(action-config): prepare for release to marketplace (#10)
Some checks failed
test / test (push) Has been cancelled
https://github.com/marketplace/actions/github-app-token is taken, hence
the rename

---------

Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
2023-08-21 14:32:39 -07:00
Parker Brown
950f8a0559 docs(README): update title, description, formatting, and more (#11)
- Update title
- Remove blockquote formatting from description to improve accessibility
- Capitalize "app" in "GitHub App" for consistency
- Add missing periods in unordered list
- Use new highlight syntax for note
2023-08-21 14:31:57 -07:00
6 changed files with 48 additions and 30 deletions

2
.github/CODEOWNERS vendored
View File

@@ -1 +1 @@
* @gr2m @parkerbxyz @actions/github-app-token-maintainers
* @gr2m @parkerbxyz @actions/create-github-app-token-maintainers

10
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"

View File

@@ -26,12 +26,7 @@ jobs:
with:
app_id: ${{ vars.RELEASER_APP_ID }}
private_key: ${{ secrets.RELEASER_APP_PRIVATE_KEY }}
- id: commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "build: update dist files"
- run: npm i semantic-release-plugin-github-breaking-version-tag
- run: npm install --no-save @semantic-release/git semantic-release-plugin-github-breaking-version-tag
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

View File

@@ -1,6 +1,6 @@
# `actions/github-app-token`
# Create GitHub App Token
> GitHub Action for creating a GitHub App Installation Access Token
GitHub Action for creating a GitHub App installation access token.
## Usage
@@ -19,7 +19,7 @@ jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/github-app-token@v1
- uses: actions/create-github-app-token@v1
id: app-token
with:
app_id: ${{ vars.APP_ID }}
@@ -40,7 +40,7 @@ jobs:
auto-format:
runs-on: ubuntu-latest
steps:
- uses: actions/github-app-token@v1
- uses: actions/create-github-app-token@v1
id: app-token
with:
# required
@@ -61,29 +61,29 @@ jobs:
### `app_id`
**Required:** GitHub app ID.
**Required:** GitHub App ID.
### `private_key`
**Required:** GitHub app private key.
**Required:** GitHub App private key.
## Outputs
### `token`
GitHub installation access token.
GitHub App installation access token.
## How it works
The action creates an installation access token using [the `POST /app/installations/{installation_id}/access_tokens` endpoint](https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app). By default,
1. The token is scoped to the current repository
2. The token inherits all the installation's permissions
3. The token is set as output `token` which can be used in subsequent steps
1. The token is scoped to the current repository.
2. The token inherits all the installation's permissions.
3. The token is set as output `token` which can be used in subsequent steps.
4. The token is revoked in the `post` step of the action, which means it cannot be passed to another job.
5. The token is masked, it cannot be logged accidentally. That is not a feature by the action, but by the GitHub Actions runner itself, due to the specific format of GitHub tokens.
> **Note**
> [!NOTE]
> Installation permissions can differ from the app's permissions they belong to. Installation permissions are set when an app is installed on an account. When the app adds more permissions after the installation, an account administrator will have to approve the new permissions before they are set on the installation.
## License

View File

@@ -1,17 +1,20 @@
name: 'github-app-token'
description: ''
author: 'Gregor Martynus and Parker Brown'
name: "Create GitHub App Token"
description: "GitHub Action for creating a GitHub App installation access token"
author: "Gregor Martynus and Parker Brown"
branding:
icon: "lock"
color: "gray-dark"
inputs:
app_id:
description: 'GitHub app ID'
description: "GitHub App ID"
required: true
private_key:
description: 'GitHub app private key'
description: "GitHub App private key"
required: true
outputs:
token:
description: 'GitHub installation access token'
description: "GitHub installation access token"
runs:
using: 'node16'
main: 'dist/main.cjs'
post: 'dist/post.cjs'
using: "node20"
main: "dist/main.cjs"
post: "dist/post.cjs"

View File

@@ -1,8 +1,8 @@
{
"name": "app-token-action",
"name": "create-github-app-token",
"private": true,
"type": "module",
"version": "1.0.0",
"version": "1.0.5",
"description": "GitHub Action for creating a GitHub App Installation Access Token",
"scripts": {
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node16.16",
@@ -27,7 +27,17 @@
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
"semantic-release-plugin-github-breaking-version-tag"
"semantic-release-plugin-github-breaking-version-tag",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"dist/*"
],
"message": "build(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
}