-
Notifications
You must be signed in to change notification settings - Fork 0
add github actions #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: Build | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
| - develop | ||
| paths-ignore: | ||
| - '.github/**' | ||
| - README.md | ||
| - gradle.properties | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| actions: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up JDK 25 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '25' | ||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Setup git credentials | ||
| uses: oleksiyrudenko/gha-git-credentials@v2 | ||
| with: | ||
| name: 'reportportal.io' | ||
| email: 'support@reportportal.io' | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build with Gradle | ||
| run: ./gradlew build --stacktrace | ||
|
|
||
| - name: Upload built jars | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: build-libs | ||
| path: build/libs/*.jar | ||
| retention-days: 1 | ||
|
|
||
| upload: | ||
| needs: build | ||
| if: github.ref_name == 'develop' || startsWith(github.ref_name, 'feature/') | ||
| uses: reportportal/.github/.github/workflows/upload-plugin-artifact.yaml@main | ||
| with: | ||
| plugin_name: ${{ github.event.repository.name }} | ||
| branch_name: ${{ github.ref_name }} | ||
| run_number: "${{ github.run_number }}" | ||
| secrets: inherit | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||
| name: Manual Release | ||||||
|
|
||||||
| on: | ||||||
| workflow_dispatch: | ||||||
| inputs: | ||||||
| version: | ||||||
| description: 'Release version' | ||||||
| required: true | ||||||
| scripts_version: | ||||||
| description: 'Gradle scripts version' | ||||||
| required: true | ||||||
| bom_version: | ||||||
| description: 'Commons bom version' | ||||||
| required: true | ||||||
|
Comment on lines
+6
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required
Please either wire the input into Gradle release properties or remove the input if the version is intentionally auto-derived. Also applies to: 48-51 🤖 Prompt for AI Agents |
||||||
|
|
||||||
| env: | ||||||
| GH_USER_NAME: github.actor | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .github/workflows/manually-release.yml | head -30Repository: reportportal/plugin-auth-github Length of output: 987 🏁 Script executed: cat .github/workflows/manually-release.yml | grep -n "GH_USER_NAME"Repository: reportportal/plugin-auth-github Length of output: 200 Use expression syntax for Line 17 stores a literal string instead of evaluating the GitHub context. Without expression syntax, Suggested fix- GH_USER_NAME: github.actor
+ GH_USER_NAME: ${{ github.actor }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| SCRIPTS_VERSION: ${{ github.event.inputs.scripts_version }} | ||||||
| BOM_VERSION: ${{ github.event.inputs.bom_version }} | ||||||
| REPOSITORY_URL: 'https://maven.pkg.github.com/' | ||||||
|
|
||||||
| jobs: | ||||||
| release: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Checkout repository | ||||||
| uses: actions/checkout@v2 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .github/workflows/manually-release.yml | head -40Repository: reportportal/plugin-auth-github Length of output: 1319 🌐 Web query:
💡 Result:
What to change in workflows - uses: actions/checkout@v6Sources Citations:
Update Line 27 is using Suggested fix- uses: actions/checkout@v2
+ uses: actions/checkout@v6📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.12)[error] 27-27: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||
|
|
||||||
| - name: Set up JDK 25 | ||||||
| uses: actions/setup-java@v4 | ||||||
| with: | ||||||
| distribution: 'temurin' | ||||||
| java-version: '25' | ||||||
|
|
||||||
| - name: Grant execute permission for gradlew | ||||||
| run: chmod +x gradlew | ||||||
|
|
||||||
| - name: Setup git credentials | ||||||
| uses: oleksiyrudenko/gha-git-credentials@v2 | ||||||
| with: | ||||||
| name: 'reportportal.io' | ||||||
| email: 'support@reportportal.io' | ||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||
|
|
||||||
| - name: Release with Gradle | ||||||
| id: release | ||||||
| run: | | ||||||
| ./gradlew release -PreleaseMode -Pscripts.version=${{env.SCRIPTS_VERSION}} -Pbom.version=${{env.BOM_VERSION}} \ | ||||||
| -PgithubUserName=${{env.GH_USER_NAME}} -PgithubToken=${{secrets.GITHUB_TOKEN}} \ | ||||||
| -PpublishRepo=${{ env.REPOSITORY_URL }}${{ github.repository }} \ | ||||||
| -PgpgPassphrase=${{secrets.GPG_PASSPHRASE}} -PgpgPrivateKey="${{secrets.GPG_PRIVATE_KEY}}" | ||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,101 @@ | ||||||||||||||||||||||||||||||
| # Copyright 2022 EPAM Systems | ||||||||||||||||||||||||||||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||||||||||||||||||||||||
| # you may not use this file except in compliance with the License. | ||||||||||||||||||||||||||||||
| # You may obtain a copy of the License at | ||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||
| # Unless required by applicable law or agreed to in writing, software | ||||||||||||||||||||||||||||||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||||||||||||||||||||||||||||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||||||||||||||||||||||||
| # See the License for the specific language governing permissions and | ||||||||||||||||||||||||||||||
| # limitations under the License. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| name: Promote | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||
| version: | ||||||||||||||||||||||||||||||
| description: 'Release version' | ||||||||||||||||||||||||||||||
| required: true | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||
| REPOSITORY_URL: 'https://maven.pkg.github.com' | ||||||||||||||||||||||||||||||
| UPSTREAM_REPOSITORY_URL: 'https://oss.sonatype.org' | ||||||||||||||||||||||||||||||
| PACKAGE_SUFFIXES: '-javadoc.jar,-javadoc.jar.asc,-sources.jar,-sources.jar.asc,.jar,.jar.asc,.pom,.pom.asc' | ||||||||||||||||||||||||||||||
| PACKAGE: 'com.epam.reportportal' | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .github/workflows/promote.ymlRepository: reportportal/plugin-auth-github Length of output: 5122 Add explicit This workflow downloads artifacts from GitHub Packages using Suggested fix+permissions:
+ packages: read
+
env:
REPOSITORY_URL: 'https://maven.pkg.github.com'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||
| - name: Get variables | ||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||
| echo "ARTIFACT=`echo ${{ github.repository }} | cut -d/ -f2- | awk '{print tolower($0)}'`" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||
| echo "PACKAGE_PATH=`echo ${{ env.PACKAGE }} | sed 's/\./\//g'`" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||
| - name: Upload package | ||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||
| IFS=',' read -a files <<< '${{ env.PACKAGE_SUFFIXES }}' | ||||||||||||||||||||||||||||||
| for f in ${files[@]}; do | ||||||||||||||||||||||||||||||
| export URL="${{ env.REPOSITORY_URL }}/${{ github.repository }}/${PACKAGE_PATH}/${ARTIFACT}/${{ github.event.inputs.version }}/${ARTIFACT}-${{ github.event.inputs.version }}${f}" | ||||||||||||||||||||||||||||||
| echo "Downloading artifact: ${URL}" | ||||||||||||||||||||||||||||||
| curl -f -u ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} -s -O -L "${URL}" | ||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||
| files=($(ls)) | ||||||||||||||||||||||||||||||
| echo 'Files downloaded:' | ||||||||||||||||||||||||||||||
| echo "${files[@]}" | ||||||||||||||||||||||||||||||
| echo 'Bundle generation' | ||||||||||||||||||||||||||||||
| export BUNDLE_FILE="bundle.jar" | ||||||||||||||||||||||||||||||
| jar -cvf ${BUNDLE_FILE} "${files[@]}" | ||||||||||||||||||||||||||||||
| echo 'Bundle upload' | ||||||||||||||||||||||||||||||
| curl -f -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -L \ | ||||||||||||||||||||||||||||||
| --request POST '${{ env.UPSTREAM_REPOSITORY_URL }}/service/local/staging/bundle_upload' \ | ||||||||||||||||||||||||||||||
| --form "file=@${BUNDLE_FILE}" >response.json | ||||||||||||||||||||||||||||||
| response_type=`jq type response.json || echo ''` | ||||||||||||||||||||||||||||||
| if [ -z "$response_type" ]; then | ||||||||||||||||||||||||||||||
| echo 'ERROR: Response is not JSON!' 1>&2 | ||||||||||||||||||||||||||||||
| cat response.json 1>&2 | ||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||
| repo=`jq -r '.repositoryUris[0]' response.json` | ||||||||||||||||||||||||||||||
| if [ -z "$repo" ]; then | ||||||||||||||||||||||||||||||
| echo 'Unable to upload bundle' 1>&2 | ||||||||||||||||||||||||||||||
|
Comment on lines
+63
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, find and inspect the workflow file
find . -name "promote.yml" -type fRepository: reportportal/plugin-auth-github Length of output: 106 🏁 Script executed: # Test how jq -r behaves with null values
# Create a test JSON with null value
echo '{"repositoryUris": [null]}' | jq -r '.repositoryUris[0]'
echo "Exit code: $?"
echo "---"
# Test with empty array
echo '{"repositoryUris": []}' | jq -r '.repositoryUris[0]'
echo "Exit code: $?"Repository: reportportal/plugin-auth-github Length of output: 114 🏁 Script executed: # Test bash -z check with "null" string
repo="null"
if [ -z "$repo" ]; then
echo "Empty string detected"
else
echo "String is not empty: '$repo'"
fi
echo "---"
# Test the proposed fix
if [ -z "$repo" ] || [ "$repo" = "null" ]; then
echo "Either empty or null detected"
else
echo "Neither empty nor null"
fiRepository: reportportal/plugin-auth-github Length of output: 136 🏁 Script executed: cat -n .github/workflows/promote.yml | sed -n '60,70p'Repository: reportportal/plugin-auth-github Length of output: 521 🏁 Script executed: # Let me also check the full context around those lines
cat -n .github/workflows/promote.yml | sed -n '55,75p'Repository: reportportal/plugin-auth-github Length of output: 1100 Handle At Lines 63–65, Suggested fix- repo=`jq -r '.repositoryUris[0]' response.json`
- if [ -z "$repo" ]; then
+ repo=`jq -r '.repositoryUris[0]' response.json`
+ if [ -z "$repo" ] || [ "$repo" = "null" ]; then
echo 'Unable to upload bundle' 1>&2
cat response.json 1>&2
exit 1
fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| cat response.json 1>&2 | ||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||
| echo "NEXUS_REPOSITORY=${repo}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||
| - name: Get repository variables | ||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||
| echo "NEXUS_REPOSITORY_NAME=`echo ${NEXUS_REPOSITORY} | sed -E 's/(.+)\/([^\/]+)$/\2/'`" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||
| - name: Promote package | ||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||
| ATTEMPTS: 60 | ||||||||||||||||||||||||||||||
| SLEEP_TIME: 10 | ||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||
| verified=false | ||||||||||||||||||||||||||||||
| for i in `seq 0 ${ATTEMPTS}`; do | ||||||||||||||||||||||||||||||
| sleep $SLEEP_TIME | ||||||||||||||||||||||||||||||
| curl -f -s -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -L \ | ||||||||||||||||||||||||||||||
| --header 'Accept: application/json' \ | ||||||||||||||||||||||||||||||
| ${{ env.UPSTREAM_REPOSITORY_URL }}/service/local/staging/repository/${NEXUS_REPOSITORY_NAME} >result.json | ||||||||||||||||||||||||||||||
| is_closed=`jq -r '.type' result.json` | ||||||||||||||||||||||||||||||
| is_transitioning=`jq -r '.transitioning' result.json` | ||||||||||||||||||||||||||||||
| echo "Current repository status: $is_closed; transitioning: $is_transitioning" | ||||||||||||||||||||||||||||||
| if [[ "$is_closed" == "closed" && "$is_transitioning" == "false" ]]; then | ||||||||||||||||||||||||||||||
| verified=true | ||||||||||||||||||||||||||||||
| break | ||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||
| if $verified; then | ||||||||||||||||||||||||||||||
| echo "A bundle was verified, releasing" | ||||||||||||||||||||||||||||||
| curl -f -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -L \ | ||||||||||||||||||||||||||||||
| --header 'Content-Type: application/json' \ | ||||||||||||||||||||||||||||||
| --data-raw "{\"data\":{\"stagedRepositoryIds\":[\"${NEXUS_REPOSITORY_NAME}\"], \"description\":\"Releasing ${{ github.event.inputs.version }}\"}}" \ | ||||||||||||||||||||||||||||||
| --request POST ${{ env.UPSTREAM_REPOSITORY_URL }}/service/local/staging/bulk/promote | ||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||
| echo 'Verification failed, please check the bundle' 1>&2 | ||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||
| name: Release | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: | ||||||
| - main | ||||||
| paths-ignore: | ||||||
| - '.github/**' | ||||||
| - README.md | ||||||
| - gradle.properties | ||||||
|
|
||||||
| env: | ||||||
| GH_USER_NAME: github.actor | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .github/workflows/release.yml | head -30Repository: reportportal/plugin-auth-github Length of output: 822 🏁 Script executed: cat -n .github/workflows/release.yml | grep -A 2 -B 2 "GH_USER_NAME"Repository: reportportal/plugin-auth-github Length of output: 552 Fix actor interpolation in env. Line 13 sets a literal string ( Suggested fix- GH_USER_NAME: github.actor
+ GH_USER_NAME: ${{ github.actor }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| SCRIPTS_VERSION: 5.14.0 | ||||||
| BOM_VERSION: 5.14.2 | ||||||
|
|
||||||
| jobs: | ||||||
| release: | ||||||
| runs-on: ubuntu-latest | ||||||
|
Comment on lines
+17
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "release.yml" -o -name "release.yaml" | head -20Repository: reportportal/plugin-auth-github Length of output: 106 🏁 Script executed: cat -n .github/workflows/release.yml 2>/dev/null || cat -n ./.github/workflows/release.yml 2>/dev/null || find . -type f \( -name "*.yml" -o -name "*.yaml" \) | grep -i releaseRepository: reportportal/plugin-auth-github Length of output: 1566 Declare explicit token permissions for release operations. This job performs authenticated release actions using Suggested fix+permissions:
+ contents: write
+ packages: write
+
jobs:
release:🤖 Prompt for AI Agents |
||||||
| steps: | ||||||
| - name: Checkout repository | ||||||
| uses: actions/checkout@v2 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Upgrade Line 22 uses Suggested fix- uses: actions/checkout@v2
+ uses: actions/checkout@v5📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.12)[error] 22-22: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||
|
|
||||||
| - name: Set up JDK 25 | ||||||
| uses: actions/setup-java@v4 | ||||||
| with: | ||||||
| distribution: 'temurin' | ||||||
| java-version: '25' | ||||||
|
|
||||||
| - name: Grant execute permission for gradlew | ||||||
| run: chmod +x gradlew | ||||||
|
|
||||||
| - name: Setup git credentials | ||||||
| uses: oleksiyrudenko/gha-git-credentials@v2 | ||||||
| with: | ||||||
| name: 'reportportal.io' | ||||||
| email: 'support@reportportal.io' | ||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||
|
|
||||||
| - name: Release with Gradle | ||||||
| id: release | ||||||
| run: | | ||||||
| ./gradlew release -PreleaseMode -Pscripts.version=${{env.SCRIPTS_VERSION}} -Pbom.version=${{env.BOM_VERSION}} \ | ||||||
| -PgithubUserName=${{env.GH_USER_NAME}} -PgithubToken=${{secrets.GITHUB_TOKEN}} \ | ||||||
| -PgpgPassphrase=${{secrets.GPG_PASSPHRASE}} -PgpgPrivateKey="${{secrets.GPG_PRIVATE_KEY}}" | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: reportportal/plugin-auth-github
Length of output: 565
🏁 Script executed:
Repository: reportportal/plugin-auth-github
Length of output: 241
Pin reusable workflow to an immutable commit SHA.
Line 57 references
@main, which is mutable. Pinning to a commit SHA avoids unintended behavior from upstream changes.Suggested change
🤖 Prompt for AI Agents