-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This pull request was automerged via backport-assistant
- Loading branch information
1 parent
3cb5931
commit 9702b8e
Showing
8 changed files
with
84 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: vault-secrets | ||
description: 'pull secrets from CI Vault into environment vars' | ||
inputs: | ||
paths: | ||
description: 'vault-action secrets input' | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Authenticate to Vault | ||
if: endsWith(github.repository, '-enterprise') | ||
id: vault-auth | ||
run: vault-auth | ||
shell: bash | ||
- name: Retrieve Vault-hosted Secrets | ||
if: endsWith(github.repository, '-enterprise') | ||
id: vault | ||
uses: hashicorp/[email protected] | ||
with: | ||
url: ${{ steps.vault-auth.outputs.addr }} | ||
caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }} | ||
token: ${{ steps.vault-auth.outputs.token }} | ||
secrets: ${{ inputs.paths }} |
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
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 |
---|---|---|
|
@@ -53,11 +53,15 @@ jobs: | |
exit 1 | ||
fi | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
- name: Setup Git | ||
- uses: ./.github/actions/vault-secrets | ||
with: | ||
paths: |- | ||
kv/data/github/hashicorp/nomad-enterprise/gha ELEVATED_GITHUB_TOKEN ; | ||
- name: Git config token | ||
if: endsWith(github.repository, '-enterprise') | ||
run: git config --global url.'https://${{ env.ELEVATED_GITHUB_TOKEN }}@github.com'.insteadOf 'https://github.com' | ||
- name: Git config user/name | ||
run: |- | ||
if [ -n "${{ secrets.ELEVATED_GITHUB_TOKEN }}" ]; then | ||
git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com/".insteadOf "https://github.com" | ||
fi | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "hc-github-team-nomad-core" | ||
|
@@ -141,7 +145,7 @@ jobs: | |
- name: Invoke build workflow | ||
id: invoke-build | ||
env: | ||
GH_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }} | ||
GH_TOKEN: ${{ env.ELEVATED_GITHUB_TOKEN || secrets.ELEVATED_GITHUB_TOKEN }} | ||
run: | | ||
gh workflow run build.yml --ref ${{ github.ref_name }} --field build-ref=${{ steps.commit-change-push.outputs.build-ref }} --field make-prerelease=false | ||
|
@@ -205,3 +209,4 @@ jobs: | |
permissions: | ||
contents: write | ||
id-token: write |
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
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