mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2024-12-28 11:06:09 -07:00
Merge pull request #7 from dawidd6/dawidd6-patch-1
Fix directory handling in post run
This commit is contained in:
commit
e3e388ffee
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -23,7 +23,7 @@ jobs:
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
playbook: playbook.yml
|
playbook: playbook.yml
|
||||||
directory: ./
|
directory: test
|
||||||
key: ${{secrets.SSH_PRIVATE_KEY}}
|
key: ${{secrets.SSH_PRIVATE_KEY}}
|
||||||
inventory: |
|
inventory: |
|
||||||
[all]
|
[all]
|
||||||
|
|
1
main.js
1
main.js
|
@ -20,6 +20,7 @@ async function main() {
|
||||||
|
|
||||||
if (directory) {
|
if (directory) {
|
||||||
process.chdir(directory)
|
process.chdir(directory)
|
||||||
|
core.saveState("directory", directory)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key) {
|
if (key) {
|
||||||
|
|
4
post.js
4
post.js
|
@ -8,10 +8,14 @@ function rm(file) {
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
try {
|
try {
|
||||||
|
const directory = core.getState("directory")
|
||||||
const keyFile = core.getState("keyFile")
|
const keyFile = core.getState("keyFile")
|
||||||
const inventoryFile = core.getState("inventoryFile")
|
const inventoryFile = core.getState("inventoryFile")
|
||||||
const vaultPasswordFile = core.getState("vaultPasswordFile")
|
const vaultPasswordFile = core.getState("vaultPasswordFile")
|
||||||
|
|
||||||
|
if (directory)
|
||||||
|
process.chdir(directory)
|
||||||
|
|
||||||
if (keyFile)
|
if (keyFile)
|
||||||
rm(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 New Issue
Block a user