Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit aad2f8e

Browse files
authored
refact: refact PR/release github-actions (#286)
* refact: refact PR github action a bit * chore: savepoint * chore: savepoint
1 parent 4222bbf commit aad2f8e

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

.github/workflows/pull-request.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ run-name: "${{ github.event.pull_request.title }} / [${{ github.actor }}] is tes
33

44
on:
55
pull_request:
6-
# pull_request_target:
76
branches:
87
- main
98
- master
@@ -12,13 +11,21 @@ on:
1211
- "**/*.md"
1312
- "README.md"
1413

14+
permissions:
15+
contents: write
16+
packages: write
17+
security-events: write
18+
pull-requests: write
19+
1520
concurrency:
1621
group: ${{ github.event.pull_request.head.repo.full_name }}-${{ github.head_ref }}/${{ github.ref }}
1722
cancel-in-progress: true
1823

1924
env:
2025
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
2126
PULL_REQUEST_BRANCH: ${{ github.head_ref }}
27+
PULL_REQUEST_HEAD: ${{ github.event.pull_request.head.sha }}
28+
CONCURRENCY_GROUP: ${{ github.event.pull_request.head.repo.full_name }}-${{ github.head_ref }}/${{ github.ref }}
2229
BRANCH: ${{ github.event.pull_request.head.ref }}
2330
REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
2431
REGISTRY: ghcr.io
@@ -41,8 +48,7 @@ jobs:
4148
- name: Checkout
4249
uses: actions/checkout@v3
4350
with:
44-
repository: ${{ env.REPOSITORY }}
45-
ref: ${{ env.BRANCH }}
51+
ref: ${{ env.PULL_REQUEST_HEAD }}
4652

4753
- name: Read config
4854
id: config
@@ -75,8 +81,7 @@ jobs:
7581
- name: Checkout
7682
uses: actions/checkout@v3
7783
with:
78-
repository: ${{ env.REPOSITORY }}
79-
ref: ${{ env.BRANCH }}
84+
ref: ${{ env.PULL_REQUEST_HEAD }}
8085

8186
- name: Setup Golang
8287
uses: actions/setup-go@v3
@@ -150,8 +155,6 @@ jobs:
150155

151156
release:
152157
runs-on: ubuntu-latest
153-
permissions:
154-
contents: write
155158
needs:
156159
- config
157160
- build
@@ -161,8 +164,7 @@ jobs:
161164
- name: Checkout
162165
uses: actions/checkout@v3
163166
with:
164-
repository: ${{ env.REPOSITORY }}
165-
ref: ${{ env.BRANCH }}
167+
ref: ${{ env.PULL_REQUEST_HEAD }}
166168

167169
- name: Set alpha version
168170
id: version
@@ -194,10 +196,6 @@ jobs:
194196

195197
deploy:
196198
name: deploy-[${{ matrix.name }}]
197-
permissions:
198-
contents: write
199-
packages: write
200-
pull-requests: write
201199
runs-on: ubuntu-latest
202200
strategy:
203201
max-parallel: 1
@@ -211,8 +209,7 @@ jobs:
211209
- name: Checkout
212210
uses: actions/checkout@v3
213211
with:
214-
repository: ${{ env.REPOSITORY }}
215-
ref: ${{ env.BRANCH }}
212+
ref: ${{ env.PULL_REQUEST_HEAD }}
216213

217214
- name: Setup instantclient cache
218215
uses: actions/cache@v3
@@ -328,9 +325,6 @@ jobs:
328325
comments:
329326
runs-on: ubuntu-latest
330327
if: ${{ needs.config.outputs.is-forked == 'false' }}
331-
permissions:
332-
contents: write
333-
pull-requests: write
334328
needs:
335329
- config
336330
- release

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ concurrency:
1212
group: ${{ github.workflow }}
1313
cancel-in-progress: false
1414

15+
permissions:
16+
contents: write
17+
packages: write
18+
security-events: write
19+
1520
env:
1621
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
1722
PULL_REQUEST_BRANCH: ${{ github.head_ref }}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ ENV PKG_CONFIG_PATH /go/src/oracledb_exporter
2828
RUN GOOS=linux GOARCH=amd64 go build -v -ldflags "-X main.Version=${VERSION} -s -w"
2929

3030
FROM ubuntu:22.10
31-
LABEL authors="Seth Miller,Yannig Perré"
32-
LABEL maintainer="Yannig Perré <yannig.perre@gmail.com>"
31+
LABEL org.opencontainers.image.authors="Seth Miller,Yannig Perré <yannig.perre@gmail.com>"
32+
LABEL org.opencontainers.image.description="Oracle DB Exporter"
3333

3434
ENV VERSION ${VERSION:-0.1.0}
3535
ENV DEBIAN_FRONTEND=noninteractive

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ push-oraclelinux-image:
102102
docker push $(IMAGE_ID)-oraclelinux
103103
ifeq ("$(RELEASE)", "true")
104104
docker push "$(IMAGE_NAME):oraclelinux"
105+
docker push "$(IMAGE_ID)-oraclelinux_legacy-tablespace"
105106
endif
106107

107108
sign-oraclelinux-image:
@@ -123,7 +124,8 @@ ubuntu-image: $(ORA_RPM)
123124
push-ubuntu-image:
124125
docker push $(IMAGE_ID)
125126
ifeq ("$(RELEASE)", "true")
126-
docker push $(IMAGE_ID_LATEST)
127+
docker push "$(IMAGE_ID_LATEST)"
128+
docker push "$(IMAGE_ID)_legacy-tablespace"
127129
endif
128130

129131
sign-ubuntu-image:

0 commit comments

Comments
 (0)