Skip to content

Commit

Permalink
Merge pull request #66 from Azure-Samples/jm-test-action-manual-branches
Browse files Browse the repository at this point in the history
Jm test action manual branches
  • Loading branch information
kjaymiller authored Oct 24, 2023
2 parents 216e13d + 251063f commit ac7df00
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
7 changes: 4 additions & 3 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"template": "https://github.com/kjaymiller/cookiecutter-relecloud",
"commit": "f77ad8b302ac9c3d851f82c7b875a200c8e876e2",
"checkout": null,
"commit": "9a4147023e7d1ab60accd7eca6ecbc8e2de38afb",
"checkout": "jm-on-stream",
"context": {
"cookiecutter": {
"project_name": "Relecloud",
Expand Down Expand Up @@ -30,6 +30,7 @@
},
"directory": null,
"skip": [
"lab"
"lab",
".github/workflows"
]
}
30 changes: 12 additions & 18 deletions .github/workflows/cruft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}"

0 comments on commit ac7df00

Please sign in to comment.