Is there a way to skip steps in github actions when spicific files have not been found in git diff #41036
Replies: 3 comments
-
Hi there @chrisaaron1 and welcome to our community! Thank you for asking a great question 🙂 To get started, introduce yourself in our official introduction thread |
Beta Was this translation helpful? Give feedback.
-
There isn't anything built-in. You can add an Keep in mind that |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Question
Body
Is there a way skip steps in github actions when specific files are not in git diff. That is, for example, if i have made a change in a js file or less file, then only the step Build Assets should run otherwise it should skip the step. I am not sure how to achieve this in github action.
Here is the yml code for the workflow -
`
name: Linux Deployment
on:
push:
branches:
- master
env:
PATH: /var/www/luksa-properties
jobs:
build:
runs-on: [self-hosted]
default:
run:
working-directory: ${{ env.PATH }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Synchornize the repository
run: |
cd /var/www/luksa-properties
git checkout
git diff
git merge origin/master
`
Any help is appreciated. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions