You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{% data reusables.actions.enterprise-github-hosted-runners %}
14
+
You can use the `jobs.<job_id>.if` conditional to prevent a job from running unless a condition is met. {% data reusables.actions.if-supported-contexts %}
15
15
16
-
##Overview
16
+
### Example: Only run job for a specific repository
17
17
18
-
{% data reusables.actions.workflows.skipped-job-status-checks-passing %}
18
+
This example uses `if` to control when the `production-deploy`job can run. It will only run if the repository is named `octo-repo-prod` and is within the `octo-org` organization. Otherwise, the job will be marked as _skipped_.
19
19
20
-
{% data reusables.actions.jobs.section-using-conditions-to-control-job-execution %}
- uses: {% data reusables.actions.action-checkout %}
29
+
- uses: {% data reusables.actions.action-setup-node %}
30
+
with:
31
+
node-version: '14'
32
+
- run: npm install -g bats
33
+
```
21
34
22
-
On a skipped job, you should see "This check was skipped."
35
+
Skipped jobs display the message "This check was skipped."
23
36
24
37
> [!NOTE]
25
-
> In some parts of the workflow you cannot use environment variables. Instead you can use contexts to access the value of an environment variable. For more information, see [AUTOTITLE](/actions/learn-github-actions/variables#using-the-env-context-to-access-environment-variable-values).
38
+
> A job that is skipped will report its status as "Success". It will not prevent a pull request from merging, even if it is a required check.
0 commit comments