Skip to content

Commit 01f896c

Browse files
bo0tzzjrasm91
andauthored
feat!: client-id input on create-workflow-token action (#1567)
* feat!: client-id input on create-workflow-token action * chore: add github secret for client_id --------- Co-authored-by: Jason Rasmussen <jason@rasm.me>
1 parent fc38a2f commit 01f896c

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

actions/create-workflow-token/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: 'Create workflow token'
22
description: 'Create an app token, with fallback to $\{{ github.token }}'
33
inputs:
4-
app-id:
5-
description: 'The GitHub App ID'
4+
client-id:
5+
description: 'The GitHub App Client ID'
66
required: false
77
private-key:
88
description: 'The GitHub App private key (PEM format)'
@@ -21,7 +21,7 @@ runs:
2121
continue-on-error: true
2222
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
2323
with:
24-
app-id: ${{ inputs.app-id }}
24+
client-id: ${{ inputs.client-id }}
2525
private-key: ${{ inputs.private-key }}
2626
- name: Set output
2727
id: output

tf/deployment/modules/shared/github/secrets/secrets.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ data "onepassword_item" "push_o_matic_app" {
5050
locals {
5151
push_o_matic_fields = {
5252
app_id = [for field in data.onepassword_item.push_o_matic_app.section[0].field : field.value if field.label == "app_id"][0]
53+
client_id = [for field in data.onepassword_item.push_o_matic_app.section[0].field : field.value if field.label == "client_id"][0]
5354
installation_id = [for field in data.onepassword_item.push_o_matic_app.section[0].field : field.value if field.label == "installation_id"][0]
5455
}
5556
}
@@ -87,6 +88,12 @@ import {
8788
id = "PUSH_O_MATIC_APP_KEY"
8889
}
8990

91+
resource "github_actions_organization_secret" "push_o_matic_app_client_id" {
92+
secret_name = "PUSH_O_MATIC_APP_CLIENT_ID"
93+
plaintext_value = local.push_o_matic_fields.client_id
94+
visibility = "all"
95+
}
96+
9097
resource "github_actions_organization_secret" "docker_hub_read_token" {
9198
secret_name = "DOCKER_HUB_READ_TOKEN"
9299
plaintext_value = data.terraform_remote_state.docker_org_state.outputs.read_token

0 commit comments

Comments
 (0)