summaryrefslogtreecommitdiffstats
path: root/pkg/model/github_context.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fix: improve warning about remote not found (#2169)Josh Soref2024-01-281-1/+1
| | | | Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* fix: ghc assignment typo (#1729)ChristopherHX2023-04-131-1/+1
| | | | | * fix: ghc assignment typo * fixup server_url
* fix: add `server_url` attribute to github context (#1727)Markus Wolf2023-04-131-0/+3
| | | | | | | | | | * fix: add `server_url` attribute to github context The `server_urL` attribute was missing in the `github` context. Previously it was exposed as environment variable only. Closes #1726 * fix: also set `api_url` and `graphql_url` attributes
* fix: correct ref and ref_name (#1672)Markus Wolf2023-03-091-1/+4
| | | | | | | | | | | * fix: correct ref and ref_name The ref in the GitHub context is always full qualified (e.g. refs/heads/branch, refs/tags/v1). The ref_name is the ref with the strippep prefix. In case of pull_requests, this is the merge commit ref (e.g. refs/pull/123/merge -> 123/merge). * test: update test data
* feat: allow overriding of `GITHUB_` env variables (#1582)Shubh Bapna2023-02-031-6/+65
| | | | | | | | | | | | | * allow overriding of GITHUB_ env variables * bug fix for overriding env vars with empty string * revert step.go * refactor github_context to prevent lint failures. added more setters * added ability to override github env variables * handled base and head ref
* fix: align github.ref to GitHub Action (#1362)Markus Wolf2022-09-271-3/+6
| | | | | | | | | | | * fix: align github.ref to GitHub Action The `github.ref` value should be `refs/heads/branch` in most cases. There are a few exceptions handled by the code. This change prefixes the default case with `refs/heads` and adds tests for this and the excpetional cases. * fix: correct existing assertions
* fix: the number in the github event is of type number (#1252)Markus Wolf2022-07-121-1/+1
| | | | | | | | | | * fix: the number in the github event is of type number The go %s formattig option outputs the type if the given input value is not of type string. * test: update test data as well * fix: use floats
* Improve logging (#1171)Björn Brauer2022-06-171-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: use logger from context wherever possible Co-authored-by: Markus Wolf <markus.wolf@new-work.se> * feat: add step/job id and results to json logs Co-authored-by: Markus Wolf <markus.wolf@new-work.se> * test: value to be masked should not be hard-coded in the action Co-authored-by: Markus Wolf <markus.wolf@new-work.se> * fix: replace values following ::add-mask:: in evaluated strings Co-authored-by: Markus Wolf <markus.wolf@new-work.se> * feat: [DEBUG] identifier for debug logs to distinguish them Co-authored-by: Markus Wolf <markus.wolf@new-work.se> * feat: replace logger with step logger The container gets injected a job logger, but during the time that steps are run, we want to use the step logger. This commit wraps pre/main/post steps in an executor that replaces the job logger with a step logger. Co-authored-by: Markus Wolf <markus.wolf@new-work.se> * feat: add pre/post stage identifier fields to json log output Co-authored-by: Markus Wolf <markus.wolf@new-work.se> * feat: add job/step result status to skipped steps/jobs Co-authored-by: Markus Wolf <markus.wolf@new-work.se> Co-authored-by: Markus Wolf <markus.wolf@new-work.se> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* refactor: remove github.com/pkg/errors dependency (#1077)R2022-06-101-3/+4
| | | | | | | | | | | | | | | * refactor: split out common/git * refactor: move git options to separate func * refactor: remove github.com/pkg/errors dependency * fix(golangci-lint): forbid github.com/pkg/errors * style: fix typo * style: fix typo Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* feat: support `GITHUB_REF_NAME` & `GITHUB_REF_TYPE` (#1142)Kevin Wang2022-05-081-0/+2
| | | | | | | | | * feat: support `_REF_NAME` & `_REF_TYPE` * chore: fix `step_test::TestSetupEnv` * fix: logic & test * test: delete `GITHUB_REF_NAME`, `GITHUB_REF_TYPE`
* feat: try to read ref and sha from event payload if available (#889)Björn Brauer2022-01-211-0/+113
| | | | | | | | | | | | | | | | | | | With this change `act` will try to populate the `githubContext.ref` and `githubContext.sha` with values read from the event payload. Caveats: - `page_build` should not have a ref - `status` should not have a ref - `registry_package` should set the ref to the branch/tag but the payload isn't documented - `workflow_call` should set ref to the same value as its caller but the payload isn't documented - most of the events should set the sha to the last commit on the ref but unfortunately the sha is not always included in the payload, therefore we use the sha from the local git checkout Co-Authored-By: Philipp Hinrichsen <philipp.hinrichsen@new-work.se> Co-authored-by: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>
* refactor: export and move shared contexts into pkg/model (#931)Björn Brauer2021-12-221-0/+28
This commit moves the githubContext, jobContext and stepResult structs from the runner package to the model package in preparation for #908 because the expression.go file lives in the runner package and would introduce cyclic dependencies with the exprparser package. Co-authored-by: Markus Wolf <markus.wolf@new-work.se> Co-authored-by: Markus Wolf <markus.wolf@new-work.se> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>