Skip to content

Commit

Permalink
Extract into separate extractInfo.js script
Browse files Browse the repository at this point in the history
  • Loading branch information
yishn committed Jan 27, 2020
1 parent 0108a3a commit b53b852
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ jobs:
- uses: actions/setup-go@v1
with:
go-version: 1.13.x
- name: Extract tag name & ci path
- name: Extract info
id: info
run: |
node -e "console.log('::set-output name=tag::' + process.env.GITHUB_REF.replace('refs/tags/', ''))"
node -e "console.log('::set-output name=ci::' + require('path').resolve(process.cwd(), './ci'))"
node ./ci/extractInfo.js
env:
GITHUB_REF: ${{ github.ref }}
- name: Create & upload artifact
Expand Down
12 changes: 12 additions & 0 deletions ci/extractInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const path = require('path')

function printSetOutputs(outputs) {
for (let [name, value] of Object.entries(outputs)) {
console.log(`::set-output name=${name}::${value}`)
}
}

printSetOutputs({
tag: process.env.GITHUB_REF.replace('refs/tags/', ''),
ci: path.resolve(process.cwd(), './ci')
})

0 comments on commit b53b852

Please sign in to comment.