{"id":14988095,"url":"https://github.com/apache/maven-gh-actions-shared","last_synced_at":"2025-06-25T22:04:23.711Z","repository":{"id":36994766,"uuid":"416949513","full_name":"apache/maven-gh-actions-shared","owner":"apache","description":"Apache Maven Shared GH Actions","archived":false,"fork":false,"pushed_at":"2025-06-09T19:50:40.000Z","size":152,"stargazers_count":7,"open_issues_count":1,"forks_count":10,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-06-16T00:57:23.864Z","etag":null,"topics":["apache-maven","build-management","hacktoberfest","java","maven"],"latest_commit_sha":null,"homepage":"https://maven.apache.org/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-10-14T01:24:53.000Z","updated_at":"2025-06-09T19:50:44.000Z","dependencies_parsed_at":"2024-01-25T23:02:25.034Z","dependency_job_id":"e166aeb9-fd36-4cf4-ba4a-2ecd72dccab6","html_url":"https://github.com/apache/maven-gh-actions-shared","commit_stats":{"total_commits":47,"total_committers":5,"mean_commits":9.4,"dds":0.5106382978723405,"last_synced_commit":"62ae657bdb42d83beb20b1529dace4c29761be34"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/apache/maven-gh-actions-shared","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fmaven-gh-actions-shared","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fmaven-gh-actions-shared/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fmaven-gh-actions-shared/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fmaven-gh-actions-shared/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/maven-gh-actions-shared/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fmaven-gh-actions-shared/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260452508,"owners_count":23011490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache-maven","build-management","hacktoberfest","java","maven"],"created_at":"2024-09-24T14:16:04.763Z","updated_at":"2025-06-25T22:04:23.702Z","avatar_url":"https://github.com/apache.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!---\n Licensed to the Apache Software Foundation (ASF) under one or more\n contributor license agreements.  See the NOTICE file distributed with\n this work for additional information regarding copyright ownership.\n The ASF licenses this file to You under the Apache License, Version 2.0\n (the \"License\"); you may not use this file except in compliance with\n the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n--\u003e\n# Apache Maven Shared GitHub Actions\n\n\n# Usage\n\nCreate GitHub workflow in project file:\n\n```\n.github/workflows/maven-verify.yml\n```\n\n with content:\n\n```yaml\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#       http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\nname: Verify\n\non:\n  push:\n  pull_request:\n\njobs:\n  build:\n    name: Verify\n    uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4\n\n```\n## Events that can trigger workflows\n\nIn such configuration workflow can be executed in the same time twice for two separate events.\n\nIt can occurs when we create PR for branch from the same repository, we have two events:\n- `push` on branch\n- `pull_request` on PR for the same branch\n\nIn order to minimize resource consumptions shared workflow from version `v2` \ndetect such situation and skips the execution for `pull_request` event \nif `PR` is created for local branch.\n\nOnly workflow for PR from external forks will be executed.\n\n## Breaking changes in V3 \n\n - replace `maven_version` by `maven-matrix` and `ff-maven`\n - rename `maven_args` to `maven-args`\n - remove not used `verify-site-goal`\n\n# Additional configurations\n\n## Attach logs on failure\n\nWe can store some logs of execution in case of failure as workflow attachments:\n\n```yaml\n...\n    uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4\n    with:\n      failure-upload-path: |\n        **/target/surefire-reports/*\n```\n## Excludes from build matrix:\n\n```yaml\n...\n    uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4\n    with:\n      matrix-exclude: \u003e\n        [ \n          {\"jdk\": \"8\"},   # exclude jdk 8 from all builds\n          {\"os\": \"windows-latest\"}, # exclude windows from all builds\n          {\"jdk\": \"8\", \"os\": \"windows-latest\"} # exclude jkd 8 on windows\n        ]\n```\n\n## Change default goals\n\n```yaml\n...\n    uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4\n    with:\n      ff-goal: 'install'\n      verify-goal: 'install -P run-its'\n```\n\n## Testing against different Maven versions\n\n```yaml\n...\n    uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4\n    with:\n      ff-maven: \"3.8.6\"                     # Maven version for fail-fast-build\n      maven-matrix: '[ \"3.2.5\", \"3.8.6\" ]'  # Maven versions matrix for verify builds\n```\n\n## Testing with Maven 4\n\n```yaml\n...\n    uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4\n    with:\n      maven4-enabled: true\n      maven4-version: 'xxx'    # only needed if you want to override default\n      verify-goal: 'verify'    # only needed if project doesn't have a run-its profile\n```\n\n## Build with Maven 4 only\n\n```yaml\n...\n    uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4\n    with:\n      maven4-build: true\n```\n\n## Disable matrix build - only fail-fast build \n\n```yaml\n...\n    uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4\n    with:\n      matrix-enabled: false\n```\n \n## More options\n\nMore options with default values can be found in workflow source in `inputs` section:\n\nhttps://github.com/apache/maven-gh-actions-shared/blob/v4/.github/workflows/maven-verify.yml\n\n# Release drafter configuration\n\n## Only default branch\n\nWe need to add an action:\n\n```\n.github/workflows/release-drafter.yml\n```\n\nwith content:\n\n```yml\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#       http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n   \nname: Release Drafter\non:\n  push:\n    branches:\n      - master\n  workflow_dispatch:\n\njobs:\n  update_release_draft:\n    uses: apache/maven-gh-actions-shared/.github/workflows/release-drafter.yml@v4\n```\n\nand configuration:\n\n```\n.github/release-drafter.yml\n```\n\nwith content:\n\n```yml\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#       http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\n_extends: maven-gh-actions-shared\n\ntag-template: \u003cproject-tag-prefix\u003e-$RESOLVED_VERSION\n```\n\n## Multiple versions from multiple branches\n\nWe need change a branch name in `.github/workflows/release-drafter.yml` in each branch:\n\n```yml\nname: Release Drafter\non:\n  push:\n    branches:\n      - branch-name # \u003c---\n  workflow_dispatch:\n```\n\n## First release from new branch\n\nWhen we create new branch for old version, release drafter will, can not find the previous release.\n\nWe need a change a `target_commitish` for the latest release.\n\nExample for `maven-clean-plugin`\n\nRelease `3.4.0` was done form master branch, next we create new branch for 3.x - `maven-clean-plugin-3.x`\n\nRelease `3.4.0` has old `target_commitish`\n\n```\ngh api /repos/apache/maven-clean-plugin/releases/tags/maven-clean-plugin-3.4.0\n\n...\n\"id\": 161340667, \u003c-- needed for update\n\"tag_name\": \"maven-clean-plugin-3.4.0\",\n\"target_commitish\": \"master\", \u003c-- shold be new branch\n...\n```\n\nWe need update it, by:\n\n```\ngh api --method PATCH /repos/apache/maven-clean-plugin/releases/161340667 -f \"target_commitish=refs/heads/maven-clean-plugin-3.x\"\n```\n\n## pre-release, beta versions\n\nTo have a `pre-release`, beta versions we need add to `.github/release-drafter.yml`\n\n```yml\ninclude-pre-releases: true\nprerelease: true\n```\n\n## Specific configuration per branch\n\nWhen we need to have different configuration for each branch we need create a new `release-drafter` configuration in **default branch** ❗❗❗️\n\nWhen configuration name is different then default, we need specified configuration name from shared repository:\n\n```yml\n_extends: maven-gh-actions-shared:.github/release-drafter.yml\n...\n```\n\nNext in each branch we need provide new configuration name in action:\n\n```\n  update_release_draft:\n    uses: apache/maven-gh-actions-shared/.github/workflows/release-drafter.yml@v4\n    with:\n      config-name: '\u003cconfig-name-per-branch\u003e' \n```\n\n# Pull Request Automation\n\nCreate GitHub workflow in project file:\n\n```\n.github/workflows/pr-automation.yml\n```\n\nwith content:\n\n```yaml\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#       http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\nname: PR Automation\non:\n  pull_request_target:\n    types:\n      - closed\n\njobs:\n  pr-automation:\n    name: PR Automation\n    uses: apache/maven-gh-actions-shared/.github/workflows/pr-automation.yml@v4\n\n```\n\nWe need a use `pull_request_target` event because we need `GITHUB_TOKEN` with write permission\nto update labels, milestones of PR from forked repositories.\n\nAfter the PR got merged each of the following actions are checked and applied if not already set:\n- default label - `maintenance` will be added\n- current milestone will be set unless PR has `skip-changelog` label\n- will be assigned to person who merged PR\n\nAfter the PR got closed without merge or has `skip-changelog` label\n-  current milestone will be removed if was set\n\n## milestone configuration\n\nWe need exactly **one** open milestone in order to detect which is current.\n\nIf we need more than one open milestone, we have to add a branch to the milestone description\n```\nbranch: \u003cbranch name\u003e\n```\n\nThis identifies the default for that branch.\n\n# Labels synchronization\n\nWe can synchronize labels for all Maven repositories by action: [Labels sync](https://github.com/apache/maven-gh-actions-shared/actions/workflows/labels-sync.yml)\n\nLabels list are in file: [./.github/labels.js](https://github.com/apache/maven-gh-actions-shared/blob/main/.github/labels.js)\n\nAction require GitHub token which will be used for performing updates.\nPlease create new [Personal access tokens (classic)](https://github.com/settings/tokens) with `repo` scope.\n\n# Management of stale issues and PRs\n\nWe need an action in project:\n\n```yml\n.github/workflows/stale.yml\n```\n\nwith body:\n\n```yml\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#       http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\nname: Stale\n\non:\n  schedule:\n    - cron: '15 3 * * *'\n  issue_comment:\n    types: [ 'created' ]\n\njobs:\n  stale:\n    uses: 'apache/maven-gh-actions-shared/.github/workflows/stale.yml@v4'\n\n```\n\nThe cron time definition can be randomly changed to avoid executing at the same time in all project.\n\n## Issues and PRs with waiting-for-feedback label\n\n- will be marked as stale after 60 days\n- will be closed after next 30 days\n- items with milestone or labels `priority:blocker`, `priority:critical` will not be checked\n- `waiting-for-feedback` label will be removed after comments\n\n# Resources\n\n- [Workflow syntax](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions)\n- [Reusing workflows](https://docs.github.com/en/actions/learn-github-actions/reusing-workflows)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fmaven-gh-actions-shared","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fmaven-gh-actions-shared","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fmaven-gh-actions-shared/lists"}