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

feature: Add support for github action variables #1833

Merged

Conversation

wildsheepz
Copy link
Contributor

Adding support for GitHub actions variables. eg. vars.ExampleVar in workflows.
#1558

@wildsheepz wildsheepz requested a review from a team as a code owner May 31, 2023 03:36
@wildsheepz wildsheepz force-pushed the support-for-Github-Actions-Variables branch from 8480e7e to d6a38d4 Compare May 31, 2023 03:46
@mergify
Copy link
Contributor

mergify bot commented May 31, 2023

@wildsheepz this pull request has failed checks 🛠

@mergify mergify bot added the needs-work Extra attention is needed label May 31, 2023
@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Merging #1833 (c5c185e) into master (4989f44) will increase coverage by 1.46%.
The diff coverage is 65.38%.

@@            Coverage Diff             @@
##           master    #1833      +/-   ##
==========================================
+ Coverage   61.22%   62.68%   +1.46%     
==========================================
  Files          46       51       +5     
  Lines        7141     8193    +1052     
==========================================
+ Hits         4372     5136     +764     
- Misses       2462     2671     +209     
- Partials      307      386      +79     
Impacted Files Coverage Δ
pkg/common/outbound_ip.go 0.00% <0.00%> (ø)
pkg/container/docker_cli.go 82.23% <ø> (ø)
pkg/container/docker_logger.go 52.08% <ø> (ø)
pkg/container/docker_run.go 13.58% <0.00%> (-0.01%) ⬇️
pkg/container/docker_volume.go 0.00% <ø> (ø)
pkg/container/file_collector.go 39.68% <0.00%> (+2.38%) ⬆️
pkg/container/host_environment.go 0.00% <0.00%> (ø)
...ontainer/linux_container_environment_extensions.go 23.07% <0.00%> (-1.25%) ⬇️
pkg/exprparser/functions.go 66.32% <0.00%> (-1.04%) ⬇️
pkg/model/workflow.go 42.33% <8.88%> (+0.21%) ⬆️
... and 26 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kuanyong-wong-partior
Copy link
Contributor

@KnisterPeter, the lint check is failing because of complexity of a function:
image
However, this function is actually a very simple function
image

@mergify
Copy link
Contributor

mergify bot commented Jun 2, 2023

@wildsheepz this pull request has failed checks 🛠

Copy link
Contributor

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

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

Maybe add // nolint:gocyclo above evaluateVariable. Idk if the other maintainer want to enforce a split of the function.

I don't insist that you remove the Syntax extension, do whatever you think is good to go with.

FYI However as long the checks are red, only the owner cplee can bypass them. Otherwise you need two approvals.

pkg/model/workflow.go Outdated Show resolved Hide resolved
pkg/model/workflow.go Outdated Show resolved Hide resolved
pkg/model/workflow.go Outdated Show resolved Hide resolved
pkg/runner/expression.go Outdated Show resolved Hide resolved
pkg/runner/expression_test.go Show resolved Hide resolved
@wildsheepz wildsheepz force-pushed the support-for-Github-Actions-Variables branch from 6a0b577 to b41728b Compare June 10, 2023 04:42
@wildsheepz wildsheepz marked this pull request as draft June 10, 2023 04:50
@wildsheepz wildsheepz marked this pull request as ready for review June 10, 2023 05:40
@mergify mergify bot removed the needs-work Extra attention is needed label Jun 10, 2023
@mergify mergify bot requested a review from a team June 10, 2023 08:45
ChristopherHX
ChristopherHX previously approved these changes Jun 10, 2023
Copy link
Contributor

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

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

Thank you for implementing this.

BTW you can do --var-file vars.yml and use well known yml syntax to define vars.

pkg/runner/expression.go Outdated Show resolved Hide resolved
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
@mergify mergify bot merged commit 6ce45e3 into nektos:master Jun 10, 2023
10 checks passed
@wildsheepz wildsheepz deleted the support-for-Github-Actions-Variables branch June 10, 2023 23:49
@askb
Copy link

askb commented Jun 27, 2023

@cplee This change is merged but only available on the master. Can we get a new release for this feature please?

@dwightgunning
Copy link

Version was bumped over the weekend however the release workflow run failed.

makrsmark pushed a commit to makrsmark/act that referenced this pull request Aug 3, 2023
Because the upstream [PR](nektos#1833) already supports variables, so this PR revert nektos#43 (commit de52913), and cherry-pick commit [6ce45e3](nektos@6ce45e3).

Co-authored-by: Kuan Yong <wong0514@gmail.com>
Reviewed-on: https://gitea.com/gitea/act/pulls/66
Reviewed-by: Jason Song <i@wolfogre.com>
Co-authored-by: sillyguodong <gedong_1994@163.com>
Co-committed-by: sillyguodong <gedong_1994@163.com>
@ZauberNerd ZauberNerd mentioned this pull request Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants