Skip to content
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

Closed
wants to merge 8 commits into from

Conversation

Goooler
Copy link
Contributor

@Goooler Goooler commented Aug 28, 2022

@Goooler Goooler requested a review from krzema12 as a code owner August 28, 2022 03:57
Copy link
Member

@krzema12 krzema12 left a 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'
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.

.github/workflows/actions-versions.main.kts Outdated Show resolved Hide resolved
@Goooler Goooler changed the title Disable check jobs in forked repository Disable periodic jobs in forked repository Aug 28, 2022
@@ -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'
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@Goooler Goooler Aug 29, 2022

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.

See Goooler/DemoApp#204, actions/runner#1189

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.

Copy link
Contributor Author

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'
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krzema12
Copy link
Member

krzema12 commented Sep 2, 2022

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' }}",
Copy link
Contributor Author

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'
Copy link
Member

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.

Copy link
Contributor Author

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 ${{ }}.

@krzema12 krzema12 linked an issue Sep 5, 2022 that may be closed by this pull request
@krzema12
Copy link
Member

krzema12 commented Sep 11, 2022

Superceded by 34cba82. Thanks again for pointing it out!

@krzema12 krzema12 closed this Sep 11, 2022
@Goooler Goooler deleted the job branch September 11, 2022 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Periodic jobs are ran for forked repos
2 participants