-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
02514c1
commit f59ad6c
Showing
4 changed files
with
103 additions
and
0 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,11 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
groups: | ||
actions-minor: | ||
update-types: | ||
- minor | ||
- patch |
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,37 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test-action: | ||
name: GitHub Actions Test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create dummy file | ||
run: | | ||
echo 'Hello World' > test-file.txt | ||
- name: Test Local Action | ||
id: test-action | ||
uses: ./ | ||
with: | ||
keeper-secret-config: ${{ secrets.KSM_CONFIG }} | ||
|
||
- name: Commit | ||
run: | | ||
git add . | ||
git commit -m "Test verified commit" | ||
git show --show-signature | ||
git verify-commit HEAD |
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 |
---|---|---|
@@ -1,2 +1,21 @@ | ||
# git-setup-action | ||
Configure Git user with signing key for Github Actions | ||
|
||
## Input | ||
|
||
| Name | Description | | ||
| ------------------------ |---------------------------------------------------------| | ||
| `keeper-secret-config` | The Keeper Secret Manager configuration | | ||
|
||
## Usage | ||
|
||
```yaml | ||
jobs: | ||
setup-git: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Git Settings | ||
uses: bonitasoft/git-setup-action@TAGNAME | ||
with: | ||
keeper-secret-config: ${{ secrets.KSM_CONFIG }} | ||
``` |
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,36 @@ | ||
name: Setup Git Settings | ||
description: Composite GitHub Action to configure Git to sign commits with CI technical user | ||
inputs: | ||
keeper-secret-config: | ||
description: The Keeper Secret Manager configuration | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Retrieve Artifactory secrets from Keeper | ||
uses: Keeper-Security/ksm-action@master | ||
with: | ||
keeper-secret-config: ${{ inputs.keeper-secret-config }} | ||
secrets: | | ||
kE5H6L68vUluOHvClGRl9A/custom_field/gpg-private-key > env.GPG_PRIVATE_KEY | ||
kE5H6L68vUluOHvClGRl9A/custom_field/gpg-passphrase > env.GPG_PASSPHRASE | ||
# commit author's name and email are set automatically with those associated to GPG key | ||
- name: Import GPG key | ||
id: import-gpg | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
gpg_private_key: ${{ env.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ env.GPG_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
git_tag_gpgsign: true | ||
|
||
- name: GPG user IDs | ||
shell: bash | ||
run: | | ||
echo "fingerprint: ${{ steps.import-gpg.outputs.fingerprint }}" | ||
echo "keyid: ${{ steps.import-gpg.outputs.keyid }}" | ||
echo "name: ${{ steps.import-gpg.outputs.name }}" | ||
echo "email: ${{ steps.import-gpg.outputs.email }}" |