-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable periodic jobs in forked repository #425
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good observation, let's save some GitHub resources and avoid failures in the forks.
@@ -10,6 +10,7 @@ name: Updates available | |||
jobs: | |||
check_yaml_consistency: | |||
runs-on: ubuntu-latest | |||
if: github.repository == 'krzema12/github-actions-kotlin-dsl' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
doesn't currently propagate to YAML consistency job (see failed run). It would be good to have a way to define it. Feel free to create a feature request for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feature is in place, it will be released this Friday. Let's wait with this PR until we can apply the condition also to the consistency job.
@@ -16,6 +16,7 @@ name: Check if wrappers up to date | |||
jobs: | |||
check_yaml_consistency: | |||
runs-on: ubuntu-latest | |||
if: env.ENABLE_PERIODIC_JOBS == 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure it works fine? I tested it and at least ${{ ... }}
is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the official documents, ${{ ... }}
is optional in if
.
https://docs.github.com/en/actions/learn-github-actions/expressions
https://docs.github.com/en/actions/learn-github-actions/environment-variables#using-contexts-to-access-environment-variable-values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But another issue is env variable seems can't be used in if
of jobs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ow, that's weird. I guess we're back to reading from github
context. Let's maybe use repository_owner
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like github.repository_owner == krzema12
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -28,6 +29,7 @@ jobs: | |||
run: git diff --exit-code '.github/workflows/check-if-wrappers-up-to-date.yaml' | |||
check: | |||
runs-on: ubuntu-latest | |||
if: github.repository == 'krzema12/github-actions-kotlin-dsl' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this YAML is not in sync with .main.kts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase and use the new feature for conditionally running the consistency job. |
@@ -26,6 +26,7 @@ workflow( | |||
job( | |||
id = "updates-available", | |||
runsOn = UbuntuLatest, | |||
condition = "\${{ github.repository_owner == 'krzema12' }}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -22,6 +23,7 @@ jobs: | |||
run: git diff --exit-code '.github/workflows/actions-versions.yaml' | |||
updates-available: | |||
runs-on: ubuntu-latest | |||
if: github.repository_owner == 'krzema12l' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you edited the YAML by hand. No need - just execute the Kotlin script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we'd better support the if
without ${{ }}
.
Superceded by 34cba82. Thanks again for pointing it out! |
See https://github.com/Goooler/github-actions-kotlin-dsl/actions?query=is%3Afailure