X-Git-Url: https://src.twobees.de/?a=blobdiff_plain;f=stow%2Foh-my-zsh%2F.oh-my-zsh%2F.github%2Fworkflows%2Fproject.yml;fp=stow%2Foh-my-zsh%2F.oh-my-zsh%2F.github%2Fworkflows%2Fproject.yml;h=0000000000000000000000000000000000000000;hb=1a8e170bbe5c6641a26ab1ce2e6ce6c5c1faa4cd;hp=999cc08e2f544a439ecac56d98de1daa0e2ce54f;hpb=475ba35502579302593f4735c853c49ef1845dcb;p=dotfiles.git diff --git a/stow/oh-my-zsh/.oh-my-zsh/.github/workflows/project.yml b/stow/oh-my-zsh/.oh-my-zsh/.github/workflows/project.yml deleted file mode 100644 index 999cc08..0000000 --- a/stow/oh-my-zsh/.oh-my-zsh/.github/workflows/project.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: Project tracking -on: - issues: - types: [opened, reopened] - pull_request_target: - types: [opened, reopened, synchronize] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -permissions: {} -jobs: - add-to-project: - name: Add to project - runs-on: ubuntu-latest - if: github.repository == 'ohmyzsh/ohmyzsh' - env: - GITHUB_TOKEN: ${{ secrets.PROJECT_TOKEN }} - steps: - - name: Read project data - env: - ORGANIZATION: ohmyzsh - PROJECT_NUMBER: "1" - run: | - # Get Project data - gh api graphql -f query=' - query($org: String!, $number: Int!) { - organization(login: $org){ - projectNext(number: $number) { - id - fields(first:20) { - nodes { - id - name - } - } - } - } - } - ' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json - - # Parse project data - cat >> $GITHUB_ENV <> $GITHUB_ENV - - - name: Classify Pull Request - if: github.event_name == 'pull_request_target' - run: | - touch plugins.list themes.list - - gh pr view ${{ github.event.pull_request.number }} \ - --repo ${{ github.repository }} \ - --json files --jq '.files.[].path' | awk -F/ ' - /^plugins\// { - plugins[$2] = 1 - } - /^themes\// { - gsub(/\.zsh-theme$/, "", $2) - themes[$2] = 1 - } - END { - for (plugin in plugins) { - print plugin >> "plugins.list" - } - for (theme in themes) { - print theme >> "themes.list" - } - } - ' - # If only one plugin is modified, add it to the plugin field - if [[ $(wc -l < plugins.list) = 1 ]]; then - echo "PLUGIN=$(cat plugins.list)" >> $GITHUB_ENV - fi - # If only one theme is modified, add it to the theme field - if [[ $(wc -l < themes.list) = 1 ]]; then - echo "THEME=$(cat themes.list)" >> $GITHUB_ENV - fi - - - name: Fill Pull Request fields in project - if: github.event_name == 'pull_request_target' - run: | - gh api graphql -f query=' - mutation ( - $project: ID! - $item: ID! - $plugin_field: ID! - $plugin_value: String! - $theme_field: ID! - $theme_value: String! - ) { - set_plugin: updateProjectNextItemField(input: { - projectId: $project - itemId: $item - fieldId: $plugin_field - value: $plugin_value - }) { - projectNextItem { - id - } - } - set_theme: updateProjectNextItemField(input: { - projectId: $project - itemId: $item - fieldId: $theme_field - value: $theme_value - }) { - projectNextItem { - id - } - } - } - ' -f project=$PROJECT_ID -f item=$ITEM_ID \ - -f plugin_field=$PLUGIN_FIELD_ID -f plugin_value=$PLUGIN \ - -f theme_field=$THEME_FIELD_ID -f theme_value=$THEME \ - --silent -