5 Commits

Author SHA1 Message Date
Dawid Dziurla
e3e388ffee Merge pull request #7 from dawidd6/dawidd6-patch-1
Fix directory handling in post run
2020-05-14 20:27:25 +02:00
Dawid Dziurla
12b09931f9 workflows: test directory 2020-05-14 20:20:43 +02:00
Dawid Dziurla
6f709ceecd add directory test playbook 2020-05-14 20:19:22 +02:00
Dawid Dziurla
89ee60634c post: change directory if saved 2020-05-14 20:16:43 +02:00
Dawid Dziurla
83c93acd55 main: save directory to state 2020-05-14 20:13:55 +02:00
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