Skip to content

Commit

Permalink
ci: try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nikbrunner committed Aug 31, 2024
1 parent 56a4cdc commit 98bbc46
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/update_supported_plugins.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: Update Supported Plugins

on:
Expand All @@ -10,37 +11,46 @@ jobs:
if: github.event_name == 'pull_request' && !github.event.pull_request.draft

steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags

- name: Check for changes in plugins directory
id: check_changes
run: |
if git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "^lua/black-atom/highlights/plugins/"; then
echo "::set-output name=changes_detected::true"
echo "Checking for changes in plugins directory..."
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep "^lua/black-atom/highlights/plugins/"; then
echo "Changes detected in plugins directory."
echo "changes_detected=true" >> $GITHUB_OUTPUT
else
echo "::set-output name=changes_detected::false"
echo "No changes detected in plugins directory."
echo "changes_detected=false" >> $GITHUB_OUTPUT
fi
- name: Update Supported Plugins
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
echo "Updating supported plugins list..."
chmod +x ./update_supported_plugins.sh
./update_supported_plugins.sh
- name: Check for README changes
id: readme_changes
run: |
echo "Checking for README changes..."
if git diff --exit-code README.md; then
echo "::set-output name=changes::false"
echo "No changes in README.md"
echo "changes=false" >> $GITHUB_OUTPUT
else
echo "::set-output name=changes::true"
echo "Changes detected in README.md"
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit README changes
if: steps.readme_changes.outputs.changes == 'true'
run: |
echo "Committing README changes..."
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add README.md
Expand All @@ -52,3 +62,15 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}

- name: Log workflow result
run: |
if [ "${{ steps.check_changes.outputs.changes_detected }}" == "true" ]; then
if [ "${{ steps.readme_changes.outputs.changes }}" == "true" ]; then
echo "Workflow completed: Changes detected and README updated."
else
echo "Workflow completed: Changes detected but no README update needed."
fi
else
echo "Workflow completed: No changes detected in plugins directory."
fi

0 comments on commit 98bbc46

Please sign in to comment.