Skip to content

Extra workflows#12226

Merged
landreev merged 12 commits intodevelopfrom
extra_workflows
Mar 18, 2026
Merged

Extra workflows#12226
landreev merged 12 commits intodevelopfrom
extra_workflows

Conversation

@landreev
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

The pr adds a couple of workflows, for deploying to internal, and for building a war file.
Note that I'm getting rid of the hard-coded "build" that follows the version number, when custom BuildNumber.properties is present.
I want it to be a generic custom label (not necessarily a Jenkins build number). I.e., the goal is not to be limited to v. 6.10 build NNNN, but to be able to have something like v. 6.10 release build or v. 6.10 official release - or something of that nature.

When run without supplying a custom label, scripts/installer/custom-build-number will continue with the legacy behavior, defaulting to build <branchname>-<checksum>

Which issue(s) this PR closes:

  • Closes #

Special notes for your reviewer:

Suggestions on how to test this:

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?:

Additional documentation:

Comment thread .github/workflows/generate_war_file.yml Fixed
Comment thread .github/workflows/deploy_to_internal.yml Fixed
Comment thread .github/workflows/deploy_to_internal.yml Fixed
Comment on lines +13 to +41
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '21'

- name: Set build number
run: scripts/installer/custom-build-number ${{ github.event.inputs.buildlabel }}

- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v6

- name: Build application war
run: mvn package

- name: Get war file name
working-directory: target
run: echo "war_file=$(ls *.war | head -1)">> $GITHUB_ENV

- name: Upload war artifact
uses: actions/upload-artifact@v7
with:
name: built-app
path: ./target/${{ env.war_file }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 2 months ago

In general, the fix is to explicitly define a permissions block in the workflow (either at the top level or under the specific job) granting only the minimal scopes required. This documents the workflow’s needs and prevents it from unintentionally inheriting broader defaults (such as full read-write on repo contents).

For this particular workflow, it only needs to read repository contents (for checkout) and use artifacts. None of the steps push commits, modify issues, or interact with pull requests, so we can safely restrict GITHUB_TOKEN to contents: read. We should add a root-level permissions block near the top of .github/workflows/generate_war_file.yml, right after the name: (or before/after on:) so that it applies to all jobs, including the build job on line 12. No imports or additional methods are needed; this is purely a YAML configuration change.

Concretely, in .github/workflows/generate_war_file.yml, insert:

permissions:
  contents: read

between the name: and on: keys (or equivalently between on: and jobs:), keeping indentation consistent. This will satisfy CodeQL and enforce least privilege without changing the workflow’s behavior.

Suggested changeset 1
.github/workflows/generate_war_file.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/generate_war_file.yml b/.github/workflows/generate_war_file.yml
--- a/.github/workflows/generate_war_file.yml
+++ b/.github/workflows/generate_war_file.yml
@@ -1,5 +1,8 @@
 name: 'Generate dataverse war file'
 
+permissions:
+  contents: read
+
 on:
   workflow_dispatch:
     inputs:
EOF
@@ -1,5 +1,8 @@
name: 'Generate dataverse war file'

permissions:
contents: read

on:
workflow_dispatch:
inputs:
Copilot is powered by AI and may make mistakes. Always verify output.
landreev and others added 4 commits March 18, 2026 17:01
…ble action

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@landreev landreev merged commit cb48a82 into develop Mar 18, 2026
9 of 10 checks passed
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 24.842%. remained the same
when pulling 8ed62f6 on extra_workflows
into d55acc6 on develop.

@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Mar 19, 2026
@pdurbin pdurbin added this to the 6.10 milestone Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

5 participants