File tree Expand file tree Collapse file tree 4 files changed +77
-10
lines changed Expand file tree Collapse file tree 4 files changed +77
-10
lines changed Original file line number Diff line number Diff line change 1+ name : Backport
2+ on :
3+ pull_request_target :
4+ types :
5+ - closed
6+ - labeled
7+
8+ jobs :
9+ backport :
10+ name : Backport
11+ runs-on : ubuntu-latest
12+ # Only react to merged PRs for security reasons.
13+ # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
14+ if : >
15+ github.event.pull_request.merged
16+ && (
17+ github.event.action == 'closed'
18+ || (
19+ github.event.action == 'labeled'
20+ && contains(github.event.label.name, 'backport')
21+ )
22+ )
23+ permissions :
24+ contents : write
25+ pull-requests : write
26+ steps :
27+ - name : GitHub App token
28+ id : github_app_token
29+ 30+ with :
31+ app_id : ${{ secrets.APP_ID }}
32+ private_key : ${{ secrets.APP_PRIVATE_KEY }}
33+ installation_id : 22958780
34+
35+ - name : Backport
36+ 37+ with :
38+ github_token : ${{ steps.github_app_token.outputs.token }}
39+ head_template : backport/backport-<%= number %>-to-<%= base %>
40+ failure_labels : backport-failed
Original file line number Diff line number Diff line change 1+ name : Delete merged branch of the backport PRs
2+ on :
3+ pull_request :
4+ types :
5+ - closed
6+
7+ jobs :
8+ delete-branch :
9+ runs-on : ubuntu-latest
10+ permissions :
11+ contents : write
12+ if : github.repository == 'opensearch-project/user-behavior-insights' && startsWith(github.event.pull_request.head.ref,'backport/')
13+ steps :
14+ - name : Delete merged branch
15+ uses : actions/github-script@v7
16+ with :
17+ script : |
18+ github.rest.git.deleteRef({
19+ owner: context.repo.owner,
20+ repo: context.repo.repo,
21+ ref: `heads/${context.payload.pull_request.head.ref}`,
22+ })
Original file line number Diff line number Diff line change 3131 export-env : true
3232 env :
3333 OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
34- SONATYPE_USERNAME : op://opensearch-infra-secrets/maven-central-portal-credentials/username
35- SONATYPE_PASSWORD : op://opensearch-infra-secrets/maven-central-portal-credentials/password
34+ MAVEN_SNAPSHOTS_S3_REPO : op://opensearch-infra-secrets/maven-snapshots-s3/repo
35+ MAVEN_SNAPSHOTS_S3_ROLE : op://opensearch-infra-secrets/maven-snapshots-s3/role
36+
37+ - name : Configure AWS credentials
38+ uses : aws-actions/configure-aws-credentials@v5
39+ with :
40+ role-to-assume : ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
41+ aws-region : us-east-1
3642
3743 - name : Publish snapshots to maven
3844 run : |
Original file line number Diff line number Diff line change @@ -54,8 +54,7 @@ buildscript {
5454
5555 repositories {
5656 mavenLocal()
57- maven { url " https://central.sonatype.com/repository/maven-snapshots/" }
58- maven { url " https://aws.oss.sonatype.org/content/repositories/snapshots" }
57+ maven { url " https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
5958 mavenCentral()
6059 maven { url " https://plugins.gradle.org/m2/" }
6160 maven { url ' https://jitpack.io' }
@@ -69,8 +68,7 @@ buildscript {
6968
7069repositories {
7170 mavenLocal()
72- maven { url " https://central.sonatype.com/repository/maven-snapshots/" }
73- maven { url " https://aws.oss.sonatype.org/content/repositories/snapshots" }
71+ maven { url " https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
7472 mavenCentral()
7573 maven { url " https://plugins.gradle.org/m2/" }
7674}
@@ -127,10 +125,11 @@ publishing {
127125 repositories {
128126 maven {
129127 name = " Snapshots"
130- url = " https://central.sonatype.com/repository/maven-snapshots/"
131- credentials {
132- username System . getenv(" SONATYPE_USERNAME" )
133- password System . getenv(" SONATYPE_PASSWORD" )
128+ url = System . getenv(" MAVEN_SNAPSHOTS_S3_REPO" )
129+ credentials(AwsCredentials ) {
130+ accessKey = System . getenv(" AWS_ACCESS_KEY_ID" )
131+ secretKey = System . getenv(" AWS_SECRET_ACCESS_KEY" )
132+ sessionToken = System . getenv(" AWS_SESSION_TOKEN" )
134133 }
135134 }
136135 maven {
You can’t perform that action at this time.
0 commit comments