Skip to content

Possible to commit files after workflow runs? #26152

Discussion options

You must be logged in to vote

Hi @chris-c-thomas ,

Github hosted runner will be released after workflow completed, thus it will not store the generated files, you need to push the files to repo.

Step1: put the generated files into dir ‘output’.

Step2: push the output folder to your repo.

You can check my sample code below, my repo here.

name: commitfiles
on: [push]

jobs:
job1:
runs-on: [ubuntu-latest]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Modify value # Tried to modify the files based on existing testfile.txt
run: |
echo 'Add value2' >> testfile.txt
- name: move to dir # Move the generated files into output folder
run: |
mkdir -p output
yes| cp -rf testfile.txt ./output/
- name: Commit files # comm…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants