generated from jdno/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.
Create GitHub Action for FlowCrafter
FlowCrafter can now be run automatically as a GitHub Action. When it detects changes to the workflows, it automatically creates a pull request to update them.
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
name: FlowCrafter | ||
|
||
"on": | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update: | ||
name: Update | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run FlowCrafter | ||
uses: ./ |
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ rules: | |
line-length: | ||
ignore: | | ||
.github/workflows/* | ||
action.yml |
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,45 @@ | ||
--- | ||
name: FlowCrafter | ||
description: Run FlowCrafter and update the GitHub Actions | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install FlowCrafter | ||
shell: bash | ||
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/jdno/flowcrafter/releases/download/v0.3.0/flowcrafter-installer.sh | sh" | ||
|
||
- name: Print FlowCrafter version | ||
shell: bash | ||
run: 'echo "Using FlowCrafter v$(flowcrafter --version)"' | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: flowcrafter update | ||
shell: bash | ||
run: "flowcrafter update" | ||
|
||
- name: Check if workflows changed | ||
id: check | ||
shell: bash | ||
run: | | ||
if git diff --cached --exit-code --quiet; then | ||
echo 'No changes detected' | ||
echo "changed=false" >> $GITHUB_OUTPUT | ||
else | ||
echo 'Changes detected' | ||
echo "changed=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Create pull request | ||
uses: peter-evans/create-pull-request@v5 | ||
if: steps.check.outputs.changed == 'true' && github.event_name != 'push' && github.event_name != 'pull_request' | ||
with: | ||
add-paths: ".github/workflows" | ||
branch: "flowcrafter/update" | ||
commit-message: "Update GitHub Actions" | ||
title: "Update GitHub Actions" | ||
body: | | ||
This pull request was automatically created by FlowCrafter after | ||
running `flowcrafter update` on the repository. |