-
Notifications
You must be signed in to change notification settings - Fork 30
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 #66 from Azure-Samples/jm-test-action-manual-branches
Jm test action manual branches
- Loading branch information
Showing
2 changed files
with
16 additions
and
21 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 |
---|---|---|
|
@@ -15,20 +15,20 @@ jobs: | |
include: | ||
- add-paths: . | ||
body: Use this to merge the changes to this repository. | ||
branch: cruft/update | ||
branch: cruft/update${{ github.run_id }} | ||
commit-message: "chore: accept new Cruft update" | ||
title: New updates detected with Cruft | ||
- add-paths: .cruft.json | ||
body: Use this to reject the changes in this repository. | ||
branch: cruft/reject | ||
branch: cruft/reject${{ github.run_id }} | ||
commit-message: "chore: reject new Cruft update" | ||
title: Reject new updates detected with Cruft | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
|
||
- name: Install Cruft | ||
run: pip3 install -r requirements-dev.in | ||
|
@@ -39,7 +39,7 @@ jobs: | |
run: | | ||
CHANGES=0 | ||
if [ -f .cruft.json ]; then | ||
if ! cruft check; then | ||
if ! cruft check --checkout="jm-on-stream"; then | ||
CHANGES=1 | ||
fi | ||
else | ||
|
@@ -54,21 +54,15 @@ jobs: | |
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub" | ||
cruft update --skip-apply-ask --refresh-private-variables | ||
cruft update --checkout="jm-on-stream" --skip-apply-ask --refresh-private-variables | ||
git restore --staged . | ||
- name: Create pull request | ||
if: steps.check.outputs.has_changes == '1' | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
add-paths: ${{ matrix.add-paths }} | ||
commit-message: ${{ matrix.commit-message }} | ||
branch: ${{ matrix.branch }} | ||
delete-branch: true | ||
branch-suffix: timestamp | ||
title: ${{ matrix.title }} | ||
body: | | ||
This is an autogenerated PR. ${{ matrix.body }} | ||
[Cruft](https://cruft.github.io/cruft/) has detected updates from the Cookiecutter repository. | ||
run: | | ||
echo "::set-output name=branch::${{ matrix.branch }}" | ||
echo "::set-output name=commit-message::${{ matrix.commit-message }}" | ||
git checkout -b "${{ matrix.branch }}" | ||
git add ${{ matrix.add-paths }} | ||
git commit -m "${{ matrix.commit-message }}" | ||
git push origin "${{ matrix.branch }}" |