Skip to content

Commit 727f5ac

Browse files
Merge pull request #13 from cncf/add-commit-signing
Add commit signing
2 parents d0420a4 + dbc2fc1 commit 727f5ac

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

calendar_update/action.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,29 @@ runs:
2020
shell: bash
2121
env:
2222
LFX_TOKEN: ${{ inputs.lfx-token }}
23+
- name: Configure git user for signed commit
24+
shell: bash
25+
run: |
26+
set -euo pipefail
27+
GIT_USER_NAME="${GITHUB_ACTOR}"
28+
GIT_USER_EMAIL="${GITHUB_ACTOR}@users.noreply.github.com"
29+
git config user.name "${GIT_USER_NAME}"
30+
git config user.email "${GIT_USER_EMAIL}"
31+
- name: Commit and push changes with DCO sign-off
32+
shell: bash
33+
run: |
34+
set -euo pipefail
35+
# Stage changes (only add the generated HTML to be safe)
36+
if [ -n "${GITHUB_WORKSPACE:-}" ] && [ -f "${GITHUB_WORKSPACE}/index.html" ]; then
37+
git add "${GITHUB_WORKSPACE}/index.html"
38+
else
39+
git add -A
40+
fi
41+
# Commit only if there are staged changes
42+
if git diff --cached --quiet; then
43+
echo "No changes to commit."
44+
exit 0
45+
fi
46+
git commit -s -m "chore(calendar): update generated index.html"
47+
# Push to the current branch's upstream
48+
git push

0 commit comments

Comments
 (0)