Merge pull request #7 from dawidd6/dawidd6-patch-1

Fix directory handling in post run
This commit is contained in:
Dawid Dziurla 2020-05-14 20:27:25 +02:00 committed by GitHub
commit e3e388ffee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View File

@ -23,7 +23,7 @@ jobs:
uses: ./
with:
playbook: playbook.yml
directory: ./
directory: test
key: ${{secrets.SSH_PRIVATE_KEY}}
inventory: |
[all]

View File

@ -20,6 +20,7 @@ async function main() {
if (directory) {
process.chdir(directory)
core.saveState("directory", directory)
}
if (key) {

View File

@ -8,10 +8,14 @@ function rm(file) {
async function main() {
try {
const directory = core.getState("directory")
const keyFile = core.getState("keyFile")
const inventoryFile = core.getState("inventoryFile")
const vaultPasswordFile = core.getState("vaultPasswordFile")
if (directory)
process.chdir(directory)
if (keyFile)
rm(keyFile)

7
test/playbook.yml Normal file
View File

@ -0,0 +1,7 @@
- name: Test Action
hosts: all
tasks:
- name: Copy action.yml
copy:
src: ../action.yml
dest: /tmp/action.yml