Skip to content

Commit

Permalink
"Execute something in dist-git" example (#743)
Browse files Browse the repository at this point in the history
"Execute something in dist-git" example

Merge after packit/packit#2081 and packit/sandcastle#197

Reviewed-by: Nikola Forró
Reviewed-by: Maja Massarini
Reviewed-by: František Lachman <[email protected]>
  • Loading branch information
softwarefactory-project-zuul[bot] authored Sep 19, 2023
2 parents 2002738 + 7753ed4 commit a13bb00
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/configuration/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,24 @@ actions:

Please note that `%changelog` expects dashes in a changelog entry, but the dash
would be interpreted by `echo` as an option so we need to quote it.

-----
Be aware, that commands do not share the working directory.
So, if you want to change the working directory of a command or multiple commands,
don't run `cd` as a separate command as shown in the following example.
This won't work as expected:

```yaml
actions:
post-upstream-clone:
- cd /tmp
- touch test_file
```

Instead, spawn a shell and change the directory as the first command:

```yaml
actions:
post-upstream-clone:
- bash -c "cd ${PACKIT_DOWNSTREAM_REPO}; touch new_file_for_dist_git.tmp"
```

0 comments on commit a13bb00

Please sign in to comment.