-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (32 loc) · 1.19 KB
/
example-02.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Test workflow for example 02
on:
push:
branches: [ main, issue-* ]
jobs:
import:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Import GPG key
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: GPG user IDs
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 }}"
- name: Sign commit and push changes
run: |
git config --global user.email "${{ steps.import-gpg.outputs.email }}"
git config --global user.name "${{ steps.import-gpg.outputs.name }}"
NOW=$(date)
echo $NOW > data/example-02/latest_datetime.txt
git add data/example-02/latest_datetime.txt
git commit -S -m "Example 02: update datetime to ${NOW}"
git push