Skip to content

Possible to commit files after workflow runs? #26152

Closed Answered by weide-zhou
chris-c-thomas asked this question in Actions
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
Labels
Product Feedback Share your thoughts and suggestions on GitHub features and improvements
2 participants