diff --git a/.github/workflows/droid.yml b/.github/workflows/droid.yml new file mode 100644 index 00000000..eb479e1a --- /dev/null +++ b/.github/workflows/droid.yml @@ -0,0 +1,38 @@ +name: Droid Tag + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + pull_request_review: + types: [submitted] + +jobs: + droid: + if: | + github.actor != 'dependabot[bot]' && ( + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@droid') && contains(fromJson('["MEMBER", "OWNER", "COLLABORATOR"]'), github.event.comment.author_association)) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@droid') && contains(fromJson('["MEMBER", "OWNER", "COLLABORATOR"]'), github.event.comment.author_association)) || + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@droid') && contains(fromJson('["MEMBER", "OWNER", "COLLABORATOR"]'), github.event.review.author_association)) + ) + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + issues: write + actions: read + env: + FACTORY_API_KEY: ${{ secrets.FACTORY_API_KEY }} + steps: + - name: Checkout repository + if: env.FACTORY_API_KEY != '' + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 + with: + fetch-depth: 1 + persist-credentials: false + - name: Run Droid Exec + if: env.FACTORY_API_KEY != '' + uses: Factory-AI/droid-action@7c7bfea2aa3bb7ea87579402cc1d89dbcf6b13b3 # main + with: + factory_api_key: ${{ env.FACTORY_API_KEY }}