Skip to content

Commit 4c04995

Browse files
committed
another try to pass vars and get commit
1 parent cf40f82 commit 4c04995

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

.github/workflows/push.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14-
check-deploy-needed:
14+
check:
1515
name: Check if result should be deployed
1616
runs-on: ubuntu-latest
1717
outputs:
@@ -35,10 +35,10 @@ jobs:
3535
GIT_COMMITTER_EMAIL: ${{ secrets.PUSH_EMAIL }}
3636
run: bash ./tools/check-deploy-needed.sh
3737

38-
build-libs:
38+
build:
3939
name: Build Libs for ${{ matrix.target }}
4040
runs-on: ubuntu-latest
41-
needs: check-deploy-needed
41+
needs: check
4242
strategy:
4343
matrix:
4444
target: [esp32, esp32s2, esp32s3, esp32c3, esp32c6, esp32h2]
@@ -57,28 +57,30 @@ jobs:
5757
# name: artifacts
5858
# path: dist
5959

60-
deploy-to-repos:
60+
deploy:
6161
name: Deploy build
6262
runs-on: ubuntu-latest
63-
needs: build-libs
63+
needs:
64+
check
65+
build
6466
steps:
6567
- uses: actions/checkout@v3
6668
- shell: bash
6769
env:
6870
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}
6971
GIT_AUTHOR_EMAIL: ${{ secrets.PUSH_EMAIL }}
7072
GIT_COMMITTER_EMAIL: ${{ secrets.PUSH_EMAIL }}
71-
IDF_COMMIT: ${{ needs.check-deploy-needed.outputs.idf_commit }}
72-
AR_BRANCH: ${{ needs.check-deploy-needed.outputs.ar_branch }}
73-
AR_NEW_COMMIT_MESSAGE: ${{ needs.check-deploy-needed.outputs.ar_new_commit_message }}
74-
AR_NEW_BRANCH_NAME: ${{ needs.check-deploy-needed.outputs.ar_new_branch_name }}
75-
AR_NEW_PR_TITLE: ${{ needs.check-deploy-needed.outputs.ar_new_pr_title }}
76-
AR_HAS_COMMIT: ${{ needs.check-deploy-needed.outputs.ar_has_commit }}
77-
AR_HAS_BRANCH: ${{ needs.check-deploy-needed.outputs.ar_has_branch }}
78-
AR_HAS_PR: ${{ needs.check-deploy-needed.outputs.ar_has_pr }}
79-
LIBS_VERSION: ${{ needs.check-deploy-needed.outputs.libs_version }}
80-
LIBS_HAS_COMMIT: ${{ needs.check-deploy-needed.outputs.libs_has_commit }}
81-
LIBS_HAS_BRANCH: ${{ needs.check-deploy-needed.outputs.libs_has_branch }}
73+
IDF_COMMIT: ${{ needs.check.outputs.idf_commit }}
74+
AR_BRANCH: ${{ needs.check.outputs.ar_branch }}
75+
AR_NEW_COMMIT_MESSAGE: ${{ needs.check.outputs.ar_new_commit_message }}
76+
AR_NEW_BRANCH_NAME: ${{ needs.check.outputs.ar_new_branch_name }}
77+
AR_NEW_PR_TITLE: ${{ needs.check.outputs.ar_new_pr_title }}
78+
AR_HAS_COMMIT: ${{ needs.check.outputs.ar_has_commit }}
79+
AR_HAS_BRANCH: ${{ needs.check.outputs.ar_has_branch }}
80+
AR_HAS_PR: ${{ needs.check.outputs.ar_has_pr }}
81+
LIBS_VERSION: ${{ needs.check.outputs.libs_version }}
82+
LIBS_HAS_COMMIT: ${{ needs.check.outputs.libs_has_commit }}
83+
LIBS_HAS_BRANCH: ${{ needs.check.outputs.libs_has_branch }}
8284
run: |
8385
echo "IDF_COMMIT: $IDF_COMMIT"
8486
echo "AR_BRANCH: $AR_BRANCH"

tools/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function github_commit_exists(){ #github_commit_exists <repo-path> <branch-name>
103103
local repo_path="$1"
104104
local branch_name="$2"
105105
local commit_message="$3"
106-
local commits_found=`curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" "https://api.github.com/repos/$repo_path/commits/?sha=$branch_name" | grep message | grep "$commit_message" | wc -l`
106+
local commits_found=`curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" "https://api.github.com/repos/$repo_path/commits/?sha=$branch_name" | jq -r '.[].commit.message' | grep "$commit_message" | wc -l`
107107
if [ ! "$commits_found" == "" ] && [ ! "$commits_found" == "null" ] && [ ! "$commits_found" == "0" ]; then echo 1; else echo 0; fi
108108
}
109109

0 commit comments

Comments
 (0)