pyTooling / Actions

Reusable steps and workflows for GitHub Actions
https://pytooling.github.io/Actions/
Other
31 stars 5 forks source link

with-post-step omits newline in GITHUB_STATE file, causes invalid state #60

Closed antoineco closed 1 year ago

antoineco commented 1 year ago

Since https://github.com/pyTooling/Actions/commit/97fd0e59278300263d86ce71e1d45f295bf76cec (v0.4.4), with-post-step writes POST=true without trailing newline, which causes the GITHUB_STATE file to look like

POST=trueMYVAR=myvalue

instead of

POST=true
MYVAR=myvalue

The example in GitHub's docs appends an explicit os.EOL at the end of the value to avoid this problem:

import * as fs from 'fs'
import * as os from 'os'

fs.appendFileSync(process.env.GITHUB_STATE, `processID=12345${os.EOL}`, {
  encoding: 'utf8'
})