Skip to content

Commit d64edbe

Browse files
authored
Added signed commits (#24)
1 parent 9fbd441 commit d64edbe

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ permissions:
1010

1111
jobs:
1212
github-action:
13-
uses: cloudposse/.github/.github/workflows/shared-release-branches.yml@main
13+
uses: cloudposse-github-actions/.github/.github/workflows/shared-release-branches.yml@main
1414
secrets: inherit

action.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,17 @@ inputs:
9090
description: "The title to use when creating a Pull Request (when commit_method: pr)"
9191

9292
pr_labels:
93-
description: "Whitespace-separated list of labels to apply to Pull Requests (when commit_method: pr)"
93+
description: "Whitespace-separated list of labels to apply to Pull Requests (when commit_method: pr or ( commit_method: commit and github context is a PR) ))"
9494
required: false
9595
default: |
9696
auto-update
9797
no-release
9898
readme
9999
100+
sign-commits:
101+
description: 'Sign commits for `pr` commit_method as `github-actions[bot]` when using `GITHUB_TOKEN`, or your own bot when using GitHub App tokens.'
102+
default: 'false'
103+
100104
atmos-version:
101105
description: The version of atmos to install
102106
required: false
@@ -109,7 +113,10 @@ outputs:
109113
readme_file:
110114
description: "Generated README file path (if readme_enabled: true)"
111115
value: "${{ steps.readme.outputs.file }}"
112-
116+
117+
changes_detected:
118+
description: "Changes detected"
119+
value: "${{ steps.auto-commit.outputs.changes_detected || steps.auto-pr.outputs.pull-request-number != false }}"
113120
runs:
114121
using: "composite"
115122
steps:
@@ -238,7 +245,7 @@ runs:
238245
- uses: gaurav-nelson/github-action-markdown-link-check@v1
239246
if: inputs.readme_enabled == 'true' && inputs.validate_readme == 'true'
240247
with:
241-
file-path: ${{ steps.readme.outputs.file }}
248+
file-path: '${{ steps.readme.outputs.file }} **/README.md'
242249
check-modified-files-only: true
243250
max-depth: 0
244251

@@ -255,7 +262,19 @@ runs:
255262
commit_author: "${{ inputs.commit_author }}"
256263
file_pattern: '${{ steps.banner.outputs.file }} ${{ steps.readme.outputs.file }}'
257264
push_options: '${{ inputs.commit_push_options }}'
258-
265+
266+
- uses: actions/github-script@v7
267+
if: steps.auto-commit.outputs.changes_detected == 'true' && inputs.commit_method == 'commit' && github.event_name == 'pull_request'
268+
with:
269+
script: |
270+
labels = '${{ inputs.pr_labels }}'.split(' ')
271+
await github.rest.issues.addLabels({
272+
issue_number: context.issue.number,
273+
owner: context.repo.owner,
274+
repo: context.repo.repo,
275+
labels: labels
276+
})
277+
259278
- name: Add Image to Step Summary
260279
if: steps.auto-commit.outputs.changes_detected == 'true' && inputs.banner_enabled == 'true' && inputs.commit_method == 'commit'
261280
shell: bash
@@ -272,18 +291,19 @@ runs:
272291
273292
- name: Create Pull Request
274293
if: inputs.commit_method == 'pr'
275-
uses: peter-evans/create-pull-request@v6
294+
uses: peter-evans/create-pull-request@v7
276295
id: auto-pr
277296
with:
278297
title: ${{ inputs.pr_title }}
279298
author: ${{ inputs.commit_author }}
280299
commit-message: ${{ inputs.commit_message }}
281300
committer: ${{ inputs.commit_author }}
301+
sign-commits: ${{ inputs.sign-commits }}
282302
add-paths: |
283303
${{ steps.banner.outputs.file }}
284304
${{ steps.readme.outputs.file }}
305+
**/README.md
285306
docs/*
286-
287307
body: |-
288308
## what
289309
This is an auto-generated PR that updates the README.md and docs

0 commit comments

Comments
 (0)