Skip to content

Commit 53442b4

Browse files
committed
adds test for destination subfolder
1 parent 4baa233 commit 53442b4

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

.github/workflows/tag.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Create Tag
2+
3+
on:
4+
push:
5+
branches:
6+
# explicit deny all here to make sure there isnt a commit loop
7+
- '!*'
8+
- main
9+
10+
jobs:
11+
create_tag:
12+
runs-on: ubuntu-latest
13+
needs: run_tests
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: check if tag already exists
19+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* && git rev-parse "$(cat VERSION)" >/dev/null 2>&1 && exit 1 || exit 0
20+
21+
- name: create tag
22+
run: git config --global user.email "${{ github.actor }}" && git config --global user.name "${{ github.actor }}" && git tag -a -m "$(cat VERSION)" $(cat VERSION) && git push --follow-tags

.github/workflows/test.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
name: Test and Tag
1+
name: Run tests
22

33
on:
44
push:
55
branches:
66
# explicit deny all here to make sure there isnt a commit loop
77
- '!*'
88
- main
9+
- fix/*
910

1011
jobs:
11-
test_and_tag:
12+
run_tests:
1213
runs-on: ubuntu-latest
1314
steps:
1415
- name: Checkout
1516
uses: actions/checkout@v2
1617

17-
- name: check if tag already exists
18-
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* && git rev-parse "$(cat VERSION)" >/dev/null 2>&1 && exit 1 || exit 0
19-
2018
- name: create test file
2119
run: echo $(date) > tmp.txt
2220

@@ -52,6 +50,15 @@ jobs:
5250
destination_folder: destination
5351
deploy_key: ${{ secrets.DEPLOY_KEY }}
5452

53+
- name: test destination subdirectory
54+
uses: ./
55+
with:
56+
source: tmp
57+
destination_repo: leigholiver/commit-with-deploy-key
58+
destination_branch: destination_subdirectory_test
59+
destination_folder: destination/destination_sub
60+
deploy_key: ${{ secrets.DEPLOY_KEY }}
61+
5562
- name: test destination directory with removal
5663
uses: ./
5764
with:
@@ -78,6 +85,3 @@ jobs:
7885
destination_branch: commit_message_test
7986
deploy_key: ${{ secrets.DEPLOY_KEY }}
8087
commit_message: testing a custom commit message (${{ github.sha }})
81-
82-
- name: create tag
83-
run: git config --global user.email "${{ github.actor }}" && git config --global user.name "${{ github.actor }}" && git tag -a -m "$(cat VERSION)" $(cat VERSION) && git push --follow-tags

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.0.1
1+
v1.0.2

0 commit comments

Comments
 (0)