generated from atls-lab/template
-
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.
Merge pull request #130 from rees46/fix/composite-action
fix: composite action
- Loading branch information
Showing
3 changed files
with
52 additions
and
10 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
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,50 @@ | ||
name: Commit changes composite | ||
description: commit made changes | ||
|
||
inputs: | ||
token: | ||
description: GitHub PAT | ||
required: true | ||
baseCommit: | ||
description: Base commit to check changes from | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: GitSign | ||
uses: chainguard-dev/actions/setup-gitsign@main | ||
shell: bash | ||
|
||
- name: Create commit message | ||
id: commit_message | ||
env: | ||
BASE_COMMIT: ${{ inputs.baseCommit }} | ||
run: | | ||
INITIAL_MESSAGE=$'chore(common): versions\n\n' | ||
temp_file=$(mktemp) | ||
yarn workspaces foreach --since=$BASE_COMMIT exec "echo \"\$npm_package_name:\$npm_package_version \" >> $temp_file" | ||
MESSAGE=$(cat $temp_file) | ||
echo $(cat $temp_file) | ||
INITIAL_MESSAGE+=$MESSAGE | ||
INITIAL_MESSAGE="${INITIAL_MESSAGE//'%'/' '}" | ||
INITIAL_MESSAGE="${INITIAL_MESSAGE//$'\n'/' '}" | ||
INITIAL_MESSAGE="${INITIAL_MESSAGE//$'\r'/' '}" | ||
echo "commitMessage=$INITIAL_MESSAGE" >> $GITHUB_OUTPUT | ||
echo $INITIAL_MESSAGE | ||
rm $temp_file | ||
shell: bash | ||
|
||
- name: Commit changes | ||
id: committer | ||
uses: EndBug/add-and-commit@v9 | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.token }} | ||
with: | ||
commit: -S | ||
default_author: github_actions | ||
author_email: github-bot@rees46.com | ||
message: ${{ steps.commit_message.outputs.commitMessage }} | ||
add: '["*.lock", "*.json", "*.yml", "*.md"]' | ||
shell: bash |
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