Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: run github actions on pull_request instead of push#1035

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
coadler merged 3 commits intomainfromcolin/actions-pr
Apr 15, 2022

Conversation

coadler
Copy link
Contributor

This might fix fork pull requests

jsjoeio reacted with eyes emoji
@coadlercoadler self-assigned thisApr 15, 2022
Comment on lines +5 to +8
branches:
- main
tags:
- "*"
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason to filter this? It's always confused me.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

If we don't limit branches for push, the workflow will run twice on every commit since both push and pull_request match

jsjoeio reacted with thumbs up emoji
tags:
- "*"

pull_request:
Copy link
Member

Choose a reason for hiding this comment

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

I think this has to bepull_request_target for external contributors to work.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I was gonna test it with just pull_request first and see if we need to add pull_request_target, i can just probably add it now

jsjoeio and kylecarbs reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we dopull_request on code-server and it works for external contributors:

https://github.com/coder/code-server/blob/main/.github/workflows/ci.yaml#L7-L9

kylecarbs reacted with hooray emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

For those not familiar, I was curious what the difference was and found a great explanation here:nf-core/tools#765 (comment)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Wouldpull_request_target mean that changes in github actions won't run for the PR?

jsjoeio reacted with eyes emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure to be honest. Based on this below:

This event runs in the context of the base of the pull request, rather than in the context of the merge commit, as the pull_request event does. This prevents execution of unsafe code from the head of the pull request that could alter your repository or steal any secrets you use in your workflow.

I'm interpreting this meaning the event/github actions will run as if it were running in the context of the fork (rather than the context of the repo you're PR'ing into). Does that sound right to you?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

It seems to me it means it runs the workflow defined in the base (the repo/branch the pr is targeting). Thisseems to mean it ignores changes to the workflow scripts in PRs until they're merged. This may be fine tbh, since we can test ourselves withworkflow_dispatch.

jsjoeio reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using pull_request_target if the workflow doesn’t need write repository permissions and doesn’t use any repository secrets. They can simply use the pull_request trigger instead.

For CI, I don't think we need write permissions or secrets so it sounds likepull_request is the way to go.

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to mean it ignores changes to the workflow scripts in PRs until they're merged.

Ah, I see what you're saying. Yeah, I agree.

@codecov
Copy link

codecovbot commentedApr 15, 2022
edited
Loading

Codecov Report

Merging#1035 (3d35bb0) intomain (88e30be) willdecrease coverage by0.15%.
The diff coverage isn/a.

@@            Coverage Diff             @@##             main    #1035      +/-   ##==========================================- Coverage   67.54%   67.38%   -0.16%==========================================  Files         259      259                Lines       15059    15059                Branches      151      151              ==========================================- Hits        10172    10148      -24- Misses       3873     3893      +20- Partials     1014     1018       +4
FlagCoverage Δ
unittest-go-macos-latest53.67% <ø> (-0.15%)⬇️
unittest-go-postgres-66.45% <ø> (-0.20%)⬇️
unittest-go-ubuntu-latest56.20% <ø> (-0.20%)⬇️
unittest-go-windows-202253.03% <ø> (+0.02%)⬆️
unittest-js68.20% <ø> (ø)
Impacted FilesCoverage Δ
pty/start_other.go64.70% <0.00%> (-23.53%)⬇️
peerbroker/dial.go77.04% <0.00%> (-6.56%)⬇️
coderd/parameter/compute.go74.07% <0.00%> (-4.45%)⬇️
coderd/provisionerdaemons.go60.37% <0.00%> (-3.61%)⬇️
cli/cliui/provisionerjob.go76.42% <0.00%> (-2.15%)⬇️
peer/channel.go83.23% <0.00%> (-1.74%)⬇️
peer/conn.go80.71% <0.00%> (-0.51%)⬇️
coderd/database/queries.sql.go83.65% <0.00%> (-0.21%)⬇️
coderd/workspaceagents.go61.60% <0.00%> (+1.78%)⬆️
provisionerd/provisionerd.go82.05% <0.00%> (+2.35%)⬆️
... and1 more

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update88e30be...3d35bb0. Read thecomment docs.

Copy link
Contributor

@jsjoeiojsjoeio left a comment

Choose a reason for hiding this comment

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

I hope thisjust works (looks promising) 🤞🏼

@coadlercoadler merged commita13ccee intomainApr 15, 2022
@coadlercoadler deleted the colin/actions-pr branchApril 15, 2022 19:55
@missknissmisskniss added this to theV2 Beta milestoneMay 15, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jsjoeiojsjoeiojsjoeio approved these changes

@kylecarbskylecarbskylecarbs approved these changes

Assignees

@coadlercoadler

Labels
None yet
Projects
None yet
Milestone
V2 Beta
Development

Successfully merging this pull request may close these issues.

4 participants
@coadler@jsjoeio@kylecarbs@misskniss

[8]ページ先頭

©2009-2025 Movatter.jp