File tree Expand file tree Collapse file tree 4 files changed +48
-6
lines changed Expand file tree Collapse file tree 4 files changed +48
-6
lines changed Original file line number Diff line number Diff line change 33Action to set a command as a post step
44
55Source Code reference: https://github.com/pyTooling/Actions/tree/main/with-post-step
6+
7+ <!-- x-release-please-start-version -->
8+
9+ ``` yaml
10+ name : CI
11+ on :
12+ pull_request :
13+
14+ jobs :
15+ build :
16+ runs-on : ubuntu-latest
17+ permissions :
18+ contents : read
19+
20+ steps :
21+ - name : Checkout
22+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+ with :
24+ persist-credentials : false
25+
26+ - name : Run Create GitHub App Token action
27+ id : command
28+ uses : ./actions/create-github-app-token
29+ run : |
30+ echo "running command"
31+ echo "test_output=test_output_content" >> "${GITHUB_OUTPUT}"
32+
33+ - name : Skip invalid instance
34+ uses : ./actions/with-post-step
35+ run : echo ${{ steps.command.outputs.test_output }}
36+ ` ` `
37+
38+ <!-- x-release-please-end-version -->
Original file line number Diff line number Diff line change 11// Reference: https://github.com/pyTooling/Actions/blob/main/with-post-step/main.js
2-
3- const { spawn } = require ( "child_process" ) ;
4- const { appendFileSync } = require ( "fs" ) ;
5- const { EOL } = require ( "os" ) ;
2+ import spawn from "child_process" ;
3+ import { appendFileSync } from "fs" ;
4+ import EOL from "os" ;
65
76function run ( cmd ) {
87 const subprocess = spawn ( cmd , { stdio : "inherit" , shell : true } ) ;
@@ -13,9 +12,11 @@ function run(cmd) {
1312
1413const key = process . env . INPUT_KEY . toUpperCase ( ) ;
1514
16- if ( process . env [ `STATE_${ key } ` ] !== undefined ) { // Are we in the 'post' step?
15+ if ( process . env [ `STATE_${ key } ` ] !== undefined ) {
16+ // Are we in the 'post' step?
1717 run ( process . env . INPUT_POST ) ;
18- } else { // Otherwise, this is the main step
18+ } else {
19+ // Otherwise, this is the main step
1920 appendFileSync ( process . env . GITHUB_STATE , `${ key } =true${ EOL } ` ) ;
2021 run ( process . env . INPUT_MAIN ) ;
2122}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import eslintPluginJest from "eslint-plugin-jest";
33import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended" ;
44import js from "@eslint/js" ;
55import tseslint from "typescript-eslint" ;
6+ import globals from "globals" ;
67
78export default tseslint . config (
89 js . configs . recommended ,
@@ -31,6 +32,9 @@ export default tseslint.config(
3132 parserOptions : {
3233 projectService : true ,
3334 } ,
35+ globals : {
36+ ...globals . node ,
37+ } ,
3438 } ,
3539 } ,
3640 {
Original file line number Diff line number Diff line change 159159 "package-name" : " validate-renovate-config" ,
160160 "extra-files" : [" README.md" ],
161161 "initial-version" : " 0.1.0"
162+ },
163+ "actions/with-post-step" : {
164+ "package-name" : " with-post-step" ,
165+ "extra-files" : [" README.md" ]
162166 }
163167 },
164168 "release-type" : " simple" ,
You can’t perform that action at this time.
0 commit comments