mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2024-11-22 15:32:18 +00:00
Merge pull request #7 from dawidd6/dawidd6-patch-1
Fix directory handling in post run
This commit is contained in:
commit
e3e388ffee
4 changed files with 13 additions and 1 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -23,7 +23,7 @@ jobs:
|
|||
uses: ./
|
||||
with:
|
||||
playbook: playbook.yml
|
||||
directory: ./
|
||||
directory: test
|
||||
key: ${{secrets.SSH_PRIVATE_KEY}}
|
||||
inventory: |
|
||||
[all]
|
||||
|
|
1
main.js
1
main.js
|
@ -20,6 +20,7 @@ async function main() {
|
|||
|
||||
if (directory) {
|
||||
process.chdir(directory)
|
||||
core.saveState("directory", directory)
|
||||
}
|
||||
|
||||
if (key) {
|
||||
|
|
4
post.js
4
post.js
|
@ -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
7
test/playbook.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
- name: Test Action
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: Copy action.yml
|
||||
copy:
|
||||
src: ../action.yml
|
||||
dest: /tmp/action.yml
|
Loading…
Reference in a new issue