replacing set-env with new environment syntax (#48)

* replacing set-env with new environment syntax
* using direct append to file for set_env instead of os.system
Signed-off-by: vsoch <vsochat@stanford.edu>
This commit is contained in:
Vanessasaurus
2020-11-17 08:33:29 -07:00
committed by GitHub
parent c39853dfde
commit c761be135f
4 changed files with 71 additions and 8 deletions

View File

@@ -93,7 +93,7 @@ Example workflows are provided in [examples](examples), and please contribute an
examples that you might have to help other users! We will walk through a basic
example here for a niche case. Let's say that we are opening a pull request on the release event. This would mean
that the payload's branch variable would be null. We would need to define `PULL_REQUEST_FROM`. How would
we do that? We can [set environment variables](https://help.github.com/en/actions/reference/development-tools-for-github-actions#set-an-environment-variable-set-env) for next steps. Here is an example:
we do that? We can [set environment variables](https://github.com/actions/toolkit/blob/main/docs/commands.md#environment-files) for next steps. Here is an example:
```yaml
name: Pull Request on Branch Push
@@ -109,7 +109,7 @@ jobs:
run: |
# do custom parsing of your code / date to derive a branch from
PR_BRANCH_FROM=release-v$(cat VERSION)
::set-env name=PULL_REQUEST_FROM_BRANCH::${PR_BRANCH_FROM}
export "PULL_REQUEST_FROM_BRANCH=${PR_BRANCH_FROM}" >> $GITHUB_ENV
- name: pull-request-action
uses: vsoch/pull-request-action@1.0.6
env: