Naming Artifacts after committed files #24947
-
Hey there. My first action works very well:
This only works if the .tex file has the name “test.tex” because the upload-artifact action is hardcoded to use the “test.pdf” file. Now my question is if there is any way to name files dynamically after the name of the .tex file because I read that substrings aren’t a thing in yml and I want to name the pdf after the tex file. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Technically you could reference the output of another step, like you do in the “Print files” step with However, as I understand the workflow there could be a list of files, right? If you want all of them it would be easier to tell
|
Beta Was this translation helpful? Give feedback.
-
Oh wow, I didn’t even think about this notation:
Thanks for your help! |
Beta Was this translation helpful? Give feedback.
-
cyb3rko:
The
cyb3rko:
There isn’t any looping on the step level, but the README for the Or you could install the necessary packages on the runner (Ubuntu has |
Beta Was this translation helpful? Give feedback.
-
airtower-luna:
Well I think that can be helpful.
airtower-luna:
Yeah I also found that but how do I format the output list to something like that:
|
Beta Was this translation helpful? Give feedback.
-
I just did some experimenting, based on hints from this thread:
Hi, I am using this code to create a release for one of our repositories: - shell: bash id: release_description run: | description=$(./resources/get_release_description.sh ${{ steps.versioning.outputs.cli_version }}) echo $description echo "::set-output name=description::$description" if: startsWith(steps.commit_message.outputs.commit_message, 'Version change') - shell: bash run: | echo ${{ steps.release_description.… The key is that to have newlines in an output you need to URL-encode them. I’ve been using Python to do the space-to-newline conversion because airtower-luna/hello-github-actions/blob/ccaec46bba8f11f342b8ba695f795b830d8d7e57/.github/workflows/multiline-output.yaml#L14-L24
You could use something similar to convert the list you have. 🙂 |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for investing time in uploading an example, I finally got it working. Thanks for your time! |
Beta Was this translation helpful? Give feedback.
Technically you could reference the output of another step, like you do in the “Print files” step with
${{ steps.files.outputs.all }}
.However, as I understand the workflow there could be a list of files, right? If you want all of them it would be easier to tell
actions/upload-artifact
to grab all PDF files: