Skip to content

Commit 4f7a0d8

Browse files
authored
Merge pull request #21 from Interguess/chore/remove-secrets
chore: remove environment variables for secrets because we dont need …
2 parents e1b5e1e + 51f7c81 commit 4f7a0d8

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

.github/workflows/analyze.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ jobs:
5151

5252
- name: Build with Gradle
5353
run: ./gradlew build --no-daemon
54-
env:
55-
IGXSYS_REED_USER: ${{ secrets.IGXSYS_REED_USER }}
56-
IGXSYS_REED_TOKEN: ${{ secrets.IGXSYS_REED_TOKEN }}
5754

5855
- name: Run Checkstyle (modern action)
5956
uses: dbelyaev/[email protected]
@@ -67,4 +64,4 @@ jobs:
6764
- name: Run PMD (all modules)
6865
uses: pmd/pmd-github-action@v2
6966
with:
70-
rulesets: '.github/config/pmd.xml'
67+
rulesets: '.github/config/pmd.xml'

.github/workflows/ci.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,17 @@ jobs:
4848
echo "REPO=${{ github.repository }}" >> state.env
4949
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> state.env
5050
echo "BASE_BRANCH=${{ github.base_ref }}" >> state.env
51-
echo "HEAD_SHA=${{ github.sha }}" >> state.env
51+
echo "HEAD_SHA=${{ github.event.pull_request.merge_commit_sha || github.sha }}" >> state.env
5252
53-
- name: Set baseTag and headTag
53+
# FIX: Nutze SHAs statt refs/heads/*
54+
- name: Set baseTag and headTag (use SHAs)
5455
id: tags
5556
shell: bash
5657
run: |
57-
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
58-
echo "baseTag=refs/heads/${{ github.base_ref }}" >> $GITHUB_ENV
59-
echo "headTag=refs/heads/${{ github.head_ref }}" >> $GITHUB_ENV
60-
else
61-
PR_URL="${{ github.event.issue.pull_request.url }}"
62-
PR_JSON=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github+json" "$PR_URL")
63-
BASE=$(echo "$PR_JSON" | jq -r .base.ref)
64-
HEAD=$(echo "$PR_JSON" | jq -r .head.ref)
65-
echo "baseTag=refs/heads/$BASE" >> $GITHUB_ENV
66-
echo "headTag=refs/heads/$HEAD" >> $GITHUB_ENV
67-
fi
58+
echo "baseTag=${{ github.event.pull_request.base.sha }}" >> $GITHUB_ENV
59+
echo "headTag=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
60+
echo "baseTag=${{ github.event.pull_request.base.sha }}" >> $GITHUB_OUTPUT
61+
echo "headTag=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
6862
6963
- name: Collect ocm lines from PR description and comments and create JSON
7064
id: collect_ocm
@@ -97,8 +91,8 @@ jobs:
9791
uses: Interguess/changelog-action@main
9892
with:
9993
token: ${{ secrets.GITHUB_TOKEN }}
100-
baseTag: ${{ env.baseTag }}
101-
headTag: ${{ env.headTag }}
94+
baseTag: ${{ env.baseTag }} # SHA
95+
headTag: ${{ env.headTag }} # SHA
10296
overrides: ${{ steps.collect_ocm.outputs.RESULT }}
10397

10498
- name: Determine BASE and last tags
@@ -109,9 +103,7 @@ jobs:
109103
BASE="${{ github.base_ref }}"
110104
echo "BASE=$BASE" | tee -a $GITHUB_ENV $GITHUB_OUTPUT
111105
echo "BASE_BRANCH=$BASE" >> state.env
112-
113106
git fetch --tags --force
114-
115107
if [[ "$BASE" == "main" ]]; then
116108
LAST_TAG=$(git tag --list --sort=-v:refname | grep -v '\-develop' | head -n1 || echo "")
117109
echo "LAST_TAG=$LAST_TAG" | tee -a $GITHUB_ENV $GITHUB_OUTPUT
@@ -304,7 +296,6 @@ jobs:
304296
|| gh api -H "Accept: application/vnd.github+json" \
305297
/users/${OWNER}/packages/container/${IMAGE}/versions --paginate 2>/dev/null
306298
}
307-
308299
if [ -n "${IMAGE_TAGS:-}" ]; then
309300
for tag in $IMAGE_TAGS; do
310301
[ -z "$tag" ] && continue
@@ -330,4 +321,4 @@ jobs:
330321
--base "${BASE_BRANCH}" \
331322
--head "revert/${HEAD_SHA}" \
332323
--title "Revert: ${HEAD_SHA} (auto-rollback)" \
333-
--body "Automatisches Rollback, da der Release-Workflow fehlgeschlagen ist." || true
324+
--body "Automatisches Rollback, da der Release-Workflow fehlgeschlagen ist." || true

0 commit comments

Comments
 (0)