Skip to content

Fix quality check workflow to not fail on outdated dependencies (#24) #37

Fix quality check workflow to not fail on outdated dependencies (#24)

Fix quality check workflow to not fail on outdated dependencies (#24) #37

Workflow file for this run

name: Welcome Contributors
on:
issues:
types: [opened]
pull_request_target:
types: [opened]
jobs:
welcome:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Welcome first-time contributors
uses: actions/github-script@v7
with:
script: |
const isIssue = context.eventName === 'issues';
const number = context.issue.number;
// Get all issues/PRs by this author
const { data: items } = isIssue
? await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
creator: context.actor,
state: 'all'
})
: await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'all'
});
// Check if this is the first contribution
const isFirstTime = items.length === 1;
if (isFirstTime) {
const message = isIssue
? `👋 **Welcome @${context.actor}!**
Thank you for opening your first issue in the docx_viewer package!

Check failure on line 45 in .github/workflows/welcome.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/welcome.yml

Invalid workflow file

You have an error in your yaml syntax on line 45
We appreciate you taking the time to report this. A maintainer will review your issue soon.
Meanwhile, please make sure you've provided:
- ✅ Clear description of the issue
- ✅ Steps to reproduce
- ✅ Flutter & Dart versions
- ✅ Platform(s) affected
Feel free to join our [discussions](https://github.com/${context.repo.owner}/${context.repo.repo}/discussions) if you have questions!`
: `🎉 **Congratulations @${context.actor}!**
Thank you for opening your first pull request! We're excited to review your contribution.
**What happens next?**
- ✅ CI checks will run automatically
- 📊 Coverage and lint reports will be posted
- 👀 A maintainer will review your changes
- 💬 We may suggest some changes or ask questions
**Tips:**
- Make sure all CI checks pass
- Keep your branch up to date with main
- Be patient - reviews may take a few days
Thank you for contributing to docx_viewer! 🚀`;
if (isIssue) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: number,
body: message
});
} else {
await github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: number,
body: message,
event: 'COMMENT'
});
}
}