Skip to content

Commit

Permalink
Auto-merged main into release/v2 on deployment.
Browse files Browse the repository at this point in the history
  • Loading branch information
strumwolf authored Feb 5, 2024
2 parents 83efb1e + a09f3f1 commit d181b8f
Show file tree
Hide file tree
Showing 8 changed files with 1,533 additions and 1,146 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
permissions: write-all
steps:
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"bracketSpacing": true,
"jsxBracketSameLine": false,
"printWidth": 80,
"semi": true,
"singleQuote": true,
Expand Down
79 changes: 39 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,46 +28,45 @@ In this case, a [GitHub App](https://docs.github.com/en/developers/apps/getting-
3. Add your GitHub App's "App ID" to your repo's [Actions Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) _(ex: `GH_APP_ID`)_
4. Add your Private Key to your repo's [Actions Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) _(ex: `GH_APP_PRIVATE_KEY`)_
5. Use [navikt/github-app-token-generator](https://github.com/navikt/github-app-token-generator) before using this action to generate a JWT

#### Example

`cleanup-pr.yml`

```
#
# Cleans up a GitHub PR
#
name: 🧼 Clean up environment
on:
pull_request:
types:
- closed
jobs:
cleanup:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
# Points to a recent commit instead of `main` to avoid supply chain attacks. (The latest tag is very old.)
- name: 🎟 Get GitHub App token
uses: navikt/github-app-token-generator@a3831f44404199df32d8f39f7c0ad9bb8fa18b1c
id: get-token
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: 🗑 Delete deployment environment
uses: strumwolf/delete-deployment-environment@v2.2.3
with:
# Use a JWT created with your GitHub App's private key
token: ${{ steps.get-token.outputs.token }}
environment: pr-${{ github.event.number }}
ref: ${{ github.ref_name }}
```

#### Example

`cleanup-pr.yml`

```yml
#
# Cleans up a GitHub PR
#
name: 🧼 Clean up environment
on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
permissions: write-all

steps:
- uses: actions/checkout@v3

# Points to a recent commit instead of `main` to avoid supply chain attacks. (The latest tag is very old.)
- name: 🎟 Get GitHub App token
uses: navikt/github-app-token-generator@a3831f44404199df32d8f39f7c0ad9bb8fa18b1c
id: get-token
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: 🗑 Delete deployment environment
uses: strumwolf/delete-deployment-environment@v2.2.3
with:
# Use a JWT created with your GitHub App's private key
token: ${{ steps.get-token.outputs.token }}
environment: pr-${{ github.event.number }}
ref: ${{ github.ref_name }}
```
## Inputs
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ inputs:
description: Only inactive deployments, keep the environment and deployments. Defaults to false
required: false
runs:
using: 'node16'
using: node20
main: 'dist/index.js'
Loading

0 comments on commit d181b8f

Please sign in to comment.