Get Project Next Fields
ActionsGitHub Action to retrieve Project Next Field data for a Project (beta) owned by a User or Organization.
The Get Project Next Fields GitHub Action was created to ease the pain of maintaining a file of constants or hardcoding values pertaining to Project Next Fields for use within a GitHub CI/CD flow.
This GitHub Action uses the GitHub GraphQL API and pagination to retrieve all Project Next Field data for a Project (beta) that is owned by a User or Organization. The action returns an easily-parseable object representing a map of all Project Next Fields for a Project (beta).
- Assumptions:
- You want to query Project Next Fields for a Project (beta) that is owned by the
gfarbUser and is assigned the number1 - You have a repository secret named
PATthat stores a Personal Access Token scoped with the appropriate permissions
- You want to query Project Next Fields for a Project (beta) that is owned by the
- Workflow:
steps: - name: Get Project Next-Fields id: project-next-fields uses: gfarb/get-project-next-fields@0.1 with: PAT: ${{ secrets.PAT }} USER: gfarb PROJECT_NEXT_NUMBER: 1
- Assumptions:
- You want to query Project Next Fields for a Project (beta) that is owned by the
githubOrganization and is assigned the number1234 - You have a repository secret named
PATthat stores a Personal Access Token scoped with the appropriate permissions
- You want to query Project Next Fields for a Project (beta) that is owned by the
- Workflow:
steps: - name: Get Project Next-Fields id: project-next-fields uses: gfarb/get-project-next-fields@0.1 with: PAT: ${{ secrets.PAT }} ORG: github PROJECT_NEXT_NUMBER: 1234
- Assumptions:
- You want to find the
idof asingle selectProject Next Field value for a specific project - The
PROJECT_NEXT_FIELDSoutput of theGet Project Next FieldsGitHub Action step was passed as an input to your future step calledPROJECT_NEXT_FIELDS - The Project Next Field is named
SingleSelectFieldNameand the value is namedSingleSelectField_Value1
- You want to find the
- Bash:
echo "$PROJECT_NEXT_FIELDS" | \ jq '.SingleSelectFieldName.settings.options | map(select(.name == "SingleSelectField_Value1")) | .[].id' - JavaScript:
const selectFieldValueId = JSON.parse(core.getInput('PROJECT_NEXT_FIELDS')) .SingleSelectFieldName .settings .options .filter(fieldOption => { return fieldOption.name === 'SingleSelectField_Value1' })[0].id;
- 0.1
- Initial Release
This project is licensed under the MIT License - see the LICENSE.md file for details
Get Project Next Fields is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.