i want to run a workflow with no user interaction needed in the command line with ubuntu. I installed gh on my ec2 instance and already logged in successfully without any user interaction needed. Can i do the same with the gh workflow run
?
I only tried the manual version which did work:
gh workflow list:
Node.js CI active 45311919
and then:
gh workflow run
(selected: Node.js CI (node.js.yml)
and then checked with this and it worked:
gh run list --workflow=node.js.yml
I am creating a cloud-init file so i cant accept user interactions. I need everything without this. Can i in addition to that let the cloud-init file stop the next commands in my cloud-init until this run is finished?
workflow file:
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
token: ${{ secrets.TOKEN_NAME }}
- run: npm ci
- run: npm run build --if-present