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

Add restriction to only run for PRs with main as the target. #86

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

zacharyDez
Copy link
Collaborator

@zacharyDez zacharyDez commented Oct 27, 2023

What I Changed

For background information: See #74.

The preview action on external forks has failed because the pr-preview-action does not support preview on external forks. Also, it intends to refrain from supporting in the future.

The PR changes the preview action to only run on PRs to main.

How I tested it

For the changes to ci.yml:

pr-test-success.json

{
  "pull_request": {
    "head": {
      "ref": "staging"
    },
    "base": {
      "ref": "main"
    }
  }
}

pr-test-fail.json

{
  "pull_request": {
    "head": {
      "ref": "random"
    },
    "base": {
      "ref": "main"
    }
  }
}

Run the workflows of the added job with:

act pull_request -W .github/workflows/ci.yml -e p.json -j pr-test-success
act pull_request -W .github/workflows/ci.yml -e p.json -j pr-test-fail

The intent is to facilitate the integration of external forks opening PRs.
@zacharyDez zacharyDez added the bug Something isn't working label Oct 27, 2023
@zacharyDez zacharyDez self-assigned this Oct 27, 2023
@zacharyDez zacharyDez changed the base branch from main to staging October 27, 2023 22:18
@github-actions
Copy link

PR Preview Action v1.4.4
🚀 Deployed preview to https://cloudnativegeo.github.io/cloud-optimized-geospatial-formats-guide/pr-preview/pr-86/
on branch gh-pages at 2023-10-27 22:19 UTC

@zacharyDez zacharyDez marked this pull request as draft October 27, 2023 23:16
@zacharyDez zacharyDez marked this pull request as ready for review October 27, 2023 23:34
@zacharyDez zacharyDez marked this pull request as draft October 27, 2023 23:34
@zacharyDez zacharyDez marked this pull request as ready for review October 27, 2023 23:36
@wildintellect
Copy link
Contributor

@zacharyDez can you explain the duplication of code across jobs in the workflow? also the json samples posted in the comments for success and fail appear to be identical - typo in copying?

@zacharyDez
Copy link
Collaborator Author

Mishaps on my side, @wildintellect . Removed the duplicates and changed the example file in the comment!

Copy link
Member

@kylebarron kylebarron left a comment

Choose a reason for hiding this comment

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

I'm not familiar with the internals of github actions here, but looks fine

@zacharyDez zacharyDez merged commit 29b8f2b into staging Oct 30, 2023
2 checks passed
@zacharyDez zacharyDez deleted the modify-preview-action branch October 30, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants