diff --git a/.github/actions/project-management-action/Dockerfile b/.github/actions/project-management-action/Dockerfile deleted file mode 100644 index 1d3301259e4e..000000000000 --- a/.github/actions/project-management-action/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# Container image that runs your code -FROM alpine:3.10 - -RUN apk add --no-cache --no-progress curl jq - -# Copies your code file from your action repository to the filesystem path `/` of the container -COPY entrypoint.sh /entrypoint.sh -RUN chmod 777 /entrypoint.sh -# Code file to execute when the docker container starts up (`entrypoint.sh`) -ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/project-management-action/LICENSE b/.github/actions/project-management-action/LICENSE deleted file mode 100644 index c4f50f8a29e8..000000000000 --- a/.github/actions/project-management-action/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Sergio Pintaldi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/.github/actions/project-management-action/README.md b/.github/actions/project-management-action/README.md deleted file mode 100644 index 1b2fa18c17e2..000000000000 --- a/.github/actions/project-management-action/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# GitHub Action for Assign to One Project - -[![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/srggrs/assign-one-project-github-action)][docker] -[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/srggrs/assign-one-project-github-action)][docker] -[![Docker Pulls](https://img.shields.io/docker/pulls/srggrs/assign-one-project-github-action)][docker] -[![GitHub license](https://img.shields.io/github/license/srggrs/assign-one-project-github-action.svg)][license] -![Latest Version](https://img.shields.io/github/v/release/srggrs/assign-one-project-github-action?color=orange&label=latest%20release) - -[docker]: https://hub.docker.com/r/srggrs/assign-one-project-github-action -[license]: https://github.com/srggrs/assign-one-project-github-action/blob/master/LICENSE - -Automatically add an issue or pull request to specific [GitHub Project](https://help.github.com/articles/about-project-boards/) when you __create__ and/or __label__ them. By default, the issues are assigned to the __`To do`__ column and the pull requests to the __`In progress`__ one, so make sure you have those columns in your project dashboard. But the workflow __allowed you to specify the column name as input__, so you can assign the issues/PRs based on a set of conditions to a specific column of a specific project. - -## Latest features: - -* included `issue_comment` as trigger for this action. -* added project pagination for searching 100+ GitHub projects. - -## Acknowledgment & Motivations - -This action has been modified from the original action from [masutaka](https://github.com/masutaka/github-actions-all-in-one-project). I needed to fix it as the original docker container would not build. Also I think the GitHub Action syntax changed a bit. - -I would like to thank @SunRunAway for adding the labelling functionality and custom column input. - -## Inputs - -### `project` - -**Required** The url of the project to be assigned to. - -### `column_name` - -The column name of the project, defaults to `'To do'` for issues and `'In progress'` for pull requests. - -## Example usage - -Examples of action: - -### Repository project - -```yaml -name: Auto Assign to Project(s) - -on: - issues: - types: [opened, labeled] - pull_request: - types: [opened, labeled] - issue_comment: - types: [created] -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - assign_one_project: - runs-on: ubuntu-latest - name: Assign to One Project - steps: - - name: Assign NEW issues and NEW pull requests to project 2 - uses: srggrs/assign-one-project-github-action@1.2.1 - if: github.event.action == 'opened' - with: - project: 'https://github.com/srggrs/assign-one-project-github-action/projects/2' - - - name: Assign issues and pull requests with `bug` label to project 3 - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, 'bug') || - contains(github.event.pull_request.labels.*.name, 'bug') - with: - project: 'https://github.com/srggrs/assign-one-project-github-action/projects/3' - column_name: 'Labeled' -``` - -#### __Notes__ -Be careful of using the conditions above (opened and labeled issues/PRs) because in such workflow, if the issue/PR is opened and labeled at the same time, it will be assigned to __both__ projects! - - -You can use any combination of conditions. For example, to assign new issues or issues labeled with 'mylabel' to a project column, use: -```yaml -... - -if: | - github.event_name == 'issues' && - ( - github.event.action == 'opened' || - contains(github.event.issue.labels.*.name, 'mylabel') - ) -... -``` - -### Organisation or User project - -Generate a token from the Organisation settings or User Settings and add it as a secret in the repository secrets as `MY_GITHUB_TOKEN` - -```yaml -name: Auto Assign to Project(s) - -on: - issues: - types: [opened, labeled] - pull_request_target: - types: [opened, labeled] - issue_comment: - types: [created] -env: - MY_GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} - -jobs: - assign_one_project: - runs-on: ubuntu-latest - name: Assign to One Project - steps: - - name: Assign NEW issues and NEW pull requests to project 2 - uses: srggrs/assign-one-project-github-action@1.2.1 - if: github.event.action == 'opened' - with: - project: 'https://github.com/srggrs/assign-one-project-github-action/projects/2' - - - name: Assign issues and pull requests with `bug` label to project 3 - uses: srggrs/assign-one-project-github-action@1.2.1 - if: | - contains(github.event.issue.labels.*.name, 'bug') || - contains(github.event.pull_request.labels.*.name, 'bug') - with: - project: 'https://github.com/srggrs/assign-one-project-github-action/projects/3' - column_name: 'Labeled' -``` - -## [Change Log](./CHANGELOG.md) - -Please refer to the list of changes [here](./CHANGELOG.md) diff --git a/.github/actions/project-management-action/action.yml b/.github/actions/project-management-action/action.yml deleted file mode 100644 index 40f7a1208834..000000000000 --- a/.github/actions/project-management-action/action.yml +++ /dev/null @@ -1,22 +0,0 @@ -# action.yml -name: 'Assign to One Project' -description: 'Assign new/labeled Issue or Pull Request to a specific project dashboard column' -author: srggrs -inputs: - project: - description: 'The url of the project to be assigned to.' - required: true - column_name: - description: 'The column name of the project, defaults to "To do" for issues and "In progress" for pull requests.' - required: false - -runs: - using: 'docker' - image: 'Dockerfile' - args: - - ${{ inputs.project }} - - ${{ inputs.column_name }} - -branding: - icon: 'box' - color: 'red' diff --git a/.github/actions/project-management-action/entrypoint.sh b/.github/actions/project-management-action/entrypoint.sh deleted file mode 100644 index 05b81c7d2d0c..000000000000 --- a/.github/actions/project-management-action/entrypoint.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -l - -PROJECT_URL="$INPUT_PROJECT" -if [ -z "$PROJECT_URL" ]; then - echo "Project input variable is not defined." >&2 - exit 1 -fi - -get_project_type() { - _PROJECT_URL="$1" - - case "$_PROJECT_URL" in - https://github.com/orgs/*) - echo "org" - ;; - https://github.com/users/*) - echo "user" - ;; - https://github.com/*/projects/*) - echo "repo" - ;; - *) - echo "Invalid Project URL: '$_PROJECT_URL' . Please pass a valid Project URL in the project input variable" >&2 - exit 1 - ;; - esac - - unset _PROJECT_URL -} - -get_next_url_from_headers() { - _HEADERS_FILE=$1 - grep -i '^link' "$_HEADERS_FILE" | tr ',' '\n'| grep \"next\" | sed 's/.*<\(.*\)>.*/\1/' -} - -find_project_id() { - _PROJECT_TYPE="$1" - _PROJECT_URL="$2" - - case "$_PROJECT_TYPE" in - org) - _ORG_NAME=$(echo "$_PROJECT_URL" | sed -e 's@https://github.com/orgs/\([^/]\+\)/projects/[0-9]\+@\1@') - _ENDPOINT="https://api.github.com/orgs/$_ORG_NAME/projects?per_page=100" - ;; - user) - _USER_NAME=$(echo "$_PROJECT_URL" | sed -e 's@https://github.com/users/\([^/]\+\)/projects/[0-9]\+@\1@') - _ENDPOINT="https://api.github.com/users/$_USER_NAME/projects?per_page=100" - ;; - repo) - _ENDPOINT="https://api.github.com/repos/$GITHUB_REPOSITORY/projects?per_page=100" - ;; - esac - - _NEXT_URL="$_ENDPOINT" - - while : ; do - - _PROJECTS=$(curl -s -X GET -u "$GITHUB_ACTOR:$TOKEN" --retry 3 \ - -H 'Accept: application/vnd.github.inertia-preview+json' \ - -D /tmp/headers \ - "$_NEXT_URL") - - _PROJECTID=$(echo "$_PROJECTS" | jq -r ".[] | select(.html_url == \"$_PROJECT_URL\").id") - _NEXT_URL=$(get_next_url_from_headers '/tmp/headers') - - if [ "$_PROJECTID" != "" ]; then - echo "$_PROJECTID" - elif [ "$_NEXT_URL" == "" ]; then - echo "No project was found." >&2 - exit 1 - fi - done - - unset _PROJECT_TYPE _PROJECT_URL _ORG_NAME _USER_NAME _ENDPOINT _PROJECTS _PROJECTID _NEXT_URL -} - -find_column_id() { - _PROJECT_ID="$1" - _INITIAL_COLUMN_NAME="$2" - - _COLUMNS=$(curl -s -X GET -u "$GITHUB_ACTOR:$TOKEN" --retry 3 \ - -H 'Accept: application/vnd.github.inertia-preview+json' \ - "https://api.github.com/projects/$_PROJECT_ID/columns") - - - echo "$_COLUMNS" | jq -r ".[] | select(.name == \"$_INITIAL_COLUMN_NAME\").id" - unset _PROJECT_ID _INITIAL_COLUMN_NAME _COLUMNS -} - -PROJECT_TYPE=$(get_project_type "${PROJECT_URL:? required this environment variable}") - -if [ "$PROJECT_TYPE" = org ] || [ "$PROJECT_TYPE" = user ]; then - if [ -z "$MY_GITHUB_TOKEN" ]; then - echo "MY_GITHUB_TOKEN not defined" >&2 - exit 1 - fi - - TOKEN="$MY_GITHUB_TOKEN" # It's User's personal access token. It should be secret. -else - if [ -z "$GITHUB_TOKEN" ]; then - echo "GITHUB_TOKEN not defined" >&2 - exit 1 - fi - - TOKEN="$GITHUB_TOKEN" # GitHub sets. The scope in only the repository containing the workflow file. -fi - -INITIAL_COLUMN_NAME="$INPUT_COLUMN_NAME" -if [ -z "$INITIAL_COLUMN_NAME" ]; then - # assing the column name by default - INITIAL_COLUMN_NAME='To do' - if [ "$GITHUB_EVENT_NAME" == "pull_request" ] || [ "$GITHUB_EVENT_NAME" == "pull_request_target" ]; then - echo "changing column name for PR event" - INITIAL_COLUMN_NAME='In progress' - fi -fi - - -PROJECT_ID=$(find_project_id "$PROJECT_TYPE" "$PROJECT_URL") -INITIAL_COLUMN_ID=$(find_column_id "$PROJECT_ID" "${INITIAL_COLUMN_NAME:? required this environment variable}") - -if [ -z "$INITIAL_COLUMN_ID" ]; then - echo "Column name '$INITIAL_COLUMN_ID' is not found." >&2 - exit 1 -fi - -case "$GITHUB_EVENT_NAME" in - issues|issue_comment) - ISSUE_ID=$(jq -r '.issue.id' < "$GITHUB_EVENT_PATH") - - # Add this issue to the project column - curl -s -X POST -u "$GITHUB_ACTOR:$TOKEN" --retry 3 \ - -H 'Accept: application/vnd.github.inertia-preview+json' \ - -d "{\"content_type\": \"Issue\", \"content_id\": $ISSUE_ID}" \ - "https://api.github.com/projects/columns/$INITIAL_COLUMN_ID/cards" - ;; - pull_request|pull_request_target) - PULL_REQUEST_ID=$(jq -r '.pull_request.id' < "$GITHUB_EVENT_PATH") - - # Add this pull_request to the project column - curl -s -X POST -u "$GITHUB_ACTOR:$TOKEN" --retry 3 \ - -H 'Accept: application/vnd.github.inertia-preview+json' \ - -d "{\"content_type\": \"PullRequest\", \"content_id\": $PULL_REQUEST_ID}" \ - "https://api.github.com/projects/columns/$INITIAL_COLUMN_ID/cards" - ;; - *) - echo "Nothing to be done on this action: '$GITHUB_EVENT_NAME'" >&2 - exit 1 - ;; -esac diff --git a/.github/disabled-workflows/issue_opened.yml b/.github/disabled-workflows/issue_opened.yml deleted file mode 100644 index b4436dca3aad..000000000000 --- a/.github/disabled-workflows/issue_opened.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This workflow runs whenever a new issue is created -name: Issue opened - -on: - issues: - types: [opened] - -permissions: {} -jobs: - automation: - runs-on: ubuntu-latest - steps: - # Add the new issue to a project board, if it needs triage - # See https://github.com/actions/add-to-project - - name: Add issue to triage board - # Only add to project board if issue is flagged as "needs triage" or has no labels - # NOTE: By default we flag new issues as "needs triage" in our issue template - if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '') - uses: actions/add-to-project@v0.5.0 - # Note, the authentication token below is an ORG level Secret. - # It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions - # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token - # This is necessary because the "DSpace Backlog" project is an org level project (i.e. not repo specific) - with: - github-token: ${{ secrets.TRIAGE_PROJECT_TOKEN }} - project-url: https://github.com/orgs/DSpace/projects/24 diff --git a/.github/disabled-workflows/label_merge_conflicts.yml b/.github/disabled-workflows/label_merge_conflicts.yml deleted file mode 100644 index d71d244c2b02..000000000000 --- a/.github/disabled-workflows/label_merge_conflicts.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow checks open PRs for merge conflicts and labels them when conflicts are found -name: Check for merge conflicts - -# Run whenever the "main" branch is updated -# NOTE: This means merge conflicts are only checked for when a PR is merged to main. -on: - push: - branches: [ main ] - # So that the `conflict_label_name` is removed if conflicts are resolved, - # we allow this to run for `pull_request_target` so that github secrets are available. - pull_request_target: - types: [ synchronize ] - -permissions: {} - -jobs: - triage: - # Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace' - if: github.repository == 'dspace/dspace' - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - # See: https://github.com/prince-chrismc/label-merge-conflicts-action - - name: Auto-label PRs with merge conflicts - uses: prince-chrismc/label-merge-conflicts-action@v2 - # Add "merge conflict" label if a merge conflict is detected. Remove it when resolved. - # Note, the authentication token is created automatically - # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token - with: - conflict_label_name: 'merge conflict' - github_token: ${{ secrets.GITHUB_TOKEN }} - conflict_comment: | - Hi @${author}, - Conflicts have been detected against the base branch. - Please [resolve these conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts) as soon as you can. Thanks! diff --git a/scripts/regenerate.bat b/scripts/regenerate.bat deleted file mode 100644 index 535474bdd978..000000000000 --- a/scripts/regenerate.bat +++ /dev/null @@ -1 +0,0 @@ -java -jar regenerate.jar diff --git a/scripts/regenerate.jar b/scripts/regenerate.jar deleted file mode 100644 index 1308ca5b7379..000000000000 Binary files a/scripts/regenerate.jar and /dev/null differ