Skip to content

Commit

Permalink
sdfg
Browse files Browse the repository at this point in the history
  • Loading branch information
zhendery committed Jan 2, 2025
1 parent bf59784 commit b09f4db
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,31 @@ env:


jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check_changes.outputs.skip }} # 将输出设置为作业输出
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check for changes
id: check_changes
run: |
echo "Checking for changes..."
CHANGED_FILES=$(git diff --name-only HEAD^)
echo "Changed files: $CHANGED_FILES"
if [ -z "$CHANGED_FILES" ] || [[ "$CHANGED_FILES" =~ ^(README\.md|docs/.*)$ ]]; then
echo "skip=true" >> $GITHUB_OUTPUT # 设置输出
else
echo "skip=false" >> $GITHUB_OUTPUT # 设置输出
fi
run-action:
runs-on: ubuntu-latest
needs: check-changes
if: ${{ needs.check-changes.outputs.skip != 'true' }} # 使用作业输出
steps:
- name: Run my action
run: echo "This action runs if changes are not only in README or docs"

0 comments on commit b09f4db

Please sign in to comment.